Git Product home page Git Product logo

flutter-ironsource-mediation-sdk's Introduction

Ironsource Flutter Mediation SDK

A Flutter plugin that uses native platform views (IOS & Android) to show IronSource banner and interstitial ads!



portfolio_view        portfolio_view

Getting Started 🚀

Initialize the plugin (Android Only):

Android Installing

Manifest Permissions #

Add the following permissions to your AndroidManifest.xml file inside the manifest tag but outside the tag:

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

Manifest Activities #

Add the following activities inside the tag in your AndroidManifest:
    <activity
                android:name="com.ironsource.sdk.controller.ControllerActivity"
                android:configChanges="orientation|screenSize"
                android:hardwareAccelerated="true" />
    <activity
                android:name="com.ironsource.sdk.controller.InterstitialActivity"
                android:configChanges="orientation|screenSize"
                android:hardwareAccelerated="true"
                android:theme="@android:style/Theme.Translucent" />
    <activity
                android:name="com.ironsource.sdk.controller.OpenUrlActivity"
                android:configChanges="orientation|screenSize"
                android:hardwareAccelerated="true"
                android:theme="@android:style/Theme.Translucent" />

Create object

    String testAppId = "9b563ab5";
    InterstitialHelper interstitialHelper = InterstitialHelper(testAppId);

Show Interstitial Ads

  • Show Interstitial Ad:
   //interstitial ready is can show?

   RaisedButton(onPressed: () {
              if (interstitialHelper.isShow()) {
                interstitialHelper.onShow();
              }



Interstitial Methods

*Methods InterstitialHelper

   //onPause interstitial just work Android

   interstitialHelper.onPause();

   //onResume interstitial just work Android

   interstitialHelper.onResume();

   //onDestroy interstitial

   interstitialHelper.onDestroy();
   
   //isShow interstitial isShowing ?
   interstitialHelper.isShow();
 
   //onShow interstitial show :)
   interstitialHelper.onShow();

Show Banner Ad:

  IronSourceBanner(
      adSize: bannerSize,
      listener: (
        IronsourceAdEvent event, Map<String, dynamic> args) {
        handleEvent(event, args, 'Banner');
       },
     ),

Future Work

  • Implement for type of rewarded and offerwall ads.

flutter-ironsource-mediation-sdk's People

Contributors

onurcanyurt avatar onurdenem avatar yunusemrecetin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

flutter-ironsource-mediation-sdk's Issues

Test Ads not displaying

Hi I will integrate my app with ironsource sdk but i have problems.
These are given errors
Rewarded Ad: Rewarded Video is not initiated with manual load
Intersitial Ad: No interstitial configurations found

My Android manifest
<activity android:name="com.ironsource.sdk.controller.ControllerActivity" android:configChanges="orientation|screenSize" android:hardwareAccelerated="true" /> <activity android:name="com.ironsource.sdk.controller.InterstitialActivity" android:configChanges="orientation|screenSize" android:hardwareAccelerated="true" android:theme="@android:style/Theme.Translucent" /> <activity android:name="com.ironsource.sdk.controller.OpenUrlActivity" android:configChanges="orientation|screenSize" android:hardwareAccelerated="true" android:theme="@android:style/Theme.Translucent" />

I added activities. and other implementations like

implementation 'com.google.android.gms:play-services-ads-identifier:18.0.1'
implementation 'com.google.android.gms:play-services-basement:18.0.0'
implementation 'com.google.android.gms:play-services-appset:16.0.2'
implementation 'com.ironsource.sdk:mediationsdk:7.2.1'

and in main initialized the ironsource

IronSource.init(appKey: '=======', adUnits: [
  IronSourceAdUnit.Interstitial,
  IronSourceAdUnit.Banner,
  IronSourceAdUnit.RewardedVideo
]);
var userId = await IronSource.getAdvertiserId();
IronSource.setAdaptersDebug(true);
await IronSource.validateIntegration();
await IronSource.setUserId(userId);`

I added the advertiser id of my emulator and real device to ironSource console.
And the issue has not been solved
Any helps please

Build failed on actual Podfile

Hi! I use last actual Podfile generated:


# Uncomment this line to define a global platform for your project
# platform :ios, '9.0'

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'

project 'Runner', {
  'Debug' => :debug,
  'Profile' => :release,
  'Release' => :release,
}

def flutter_root
  generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
  unless File.exist?(generated_xcode_build_settings_path)
    raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
  end

  File.foreach(generated_xcode_build_settings_path) do |line|
    matches = line.match(/FLUTTER_ROOT\=(.*)/)
    return matches[1].strip if matches
  end
  raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
end

require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)

flutter_ios_podfile_setup

target 'Runner' do
  use_frameworks!
  use_modular_headers!

  flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
end

post_install do |installer|
  installer.pods_project.targets.each do |target|
    flutter_additional_ios_build_settings(target)
  end
end

and get some error:

(/somepath/build/ios/Release-app_dev-iphoneos/Promis
    esObjC/FBLPromises.framework/FBLPromises) was built for newer iOS version
    (9.0) than being linked (8.0)
    <module-includes>:1:9: note: in file included from <module-includes>:1:
    #import "Headers/ironsource_flutter_ads-umbrella.h"
            ^
    /somepath/ios/Pods/Target Support
    Files/ironsource_flutter_ads/ironsource_flutter_ads-umbrella.h:13:9: note:
    in file included from /somepath/ios/Pods/Target Support
    Files/ironsource_flutter_ads/ironsource_flutter_ads-umbrella.h:13:
    #import "IronsourceFlutterAdsPlugin.h"
            ^
    /somepath/flutter-ironsource-mediation-sdk/ios/Classes/Ironsou
    rceFlutterAdsPlugin.h:2:9: error: include of non-modular header inside
    framework module 'ironsource_flutter_ads.IronsourceFlutterAdsPlugin':
    '/somepath/ios/Pods/IronSourceSDK/IronSource/IronSource
    .framework/Headers/IronSource.h'
    #import "IronSource/IronSource.h"
            ^
    <unknown>:0: error: could not build Objective-C module
    'ironsource_flutter_ads'

I try define modular in podspec
s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'VALID_ARCHS[sdk=iphonesimulator*]' => 'x86_64' }
but still getting error.

Your podfile is outdated. Please help how to fix podfile?

You can remove Podfile and change min iOS to 10 then build project (flutter build ios --no-codesign) to reproduce this error.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.