Flutter unity mediation - Unity Mediation plugin for Flutter Applications. This plugin is able to display Rewarded and Interstitial Ads from different ad sources

Overview

Unity Mediation

Pub License Pub likes Pub popularity Pub points Flutter platform

Buy Me A Coffee PayPal

Unity Mediation plugin for Flutter Applications. This plugin is able to display Rewarded and Interstitial Ads from different ad sources.

If your application uses only ads from Unity Ads source use Unity Ads Plugin.

Getting Started

1. Configure

iOS

  • set iOS version to 9.0 or higher in ios/Podfile file
  • in ios/Podfile file add next lines after platform :ios line:
source 'https://github.com/CocoaPods/Specs.git'
source 'https://github.com/Unity-Technologies/unity-mediation-cocoapods-prod.git'

Android

  • set minSdkVersion to 21 in android/app/build.gradle file

2. Configure ad sources

For using additional advertising sources, it's needed to configure them.

iOS

Add dependencies of configured ad sources to ios/Podfile file from the table below

target 'Runner' do
  use_frameworks!
  use_modular_headers!
  # list of adapters
  flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
end

AdMob ad source requires additional configuration. If you use AdMob add your AdMob app ID to ios/Runner/Info.plist file

<key>GADApplicationIdentifier</key>
<string>YOUR_ADMOB_APP_ID</string>

Android

Add dependencies of configured ad sources to android/app/build.gradle file

dependencies {
    // list of adapters
}

AdMob ad source requires additional configuration. If you use AdMob add your AdMob app ID to android/app/src/main/AndroidManifest.xml file

<manifest>
    <application>
        <meta-data
            android:name="com.google.android.gms.ads.APPLICATION_ID"
            android:value="YOUR_ADMOB_APP_ID"/>
    </application>
</manifest>

Ad Sources

Source iOS Android
AdColony pod 'UnityMediationAdColonyAdapter' implementation "com.unity3d.mediation:adcolony-adapter:0.3.0"
AppLovin pod 'UnityMediationAppLovinAdapter' implementation "com.unity3d.mediation:applovin-adapter:0.3.0"
IronSource pod 'UnityMediationIronSourceAdapter' implementation "com.unity3d.mediation:ironsource-adapter:0.3.0"
Vungle pod 'UnityMediationVungleAdapter' implementation "com.unity3d.mediation:vungle-adapter:0.3.0"
Meta Audience Network pod 'UnityMediationFacebookAdapter' implementation "com.unity3d.mediation:facebook-adapter:0.3.0"
AdMob pod 'UnityMediationAdmobAdapter' implementation "com.unity3d.mediation:admob-adapter:0.3.0"

3. Initialization

Initialize Unity Mediation with your game ID

UnityMediation.initialize(
  gameId: 'GAME_ID',
  onComplete: () => print('Initialization Complete'),
  onFailed: (error, message) => print('Initialization Failed: $error $message'),
);

4. Rewarded Ad

Rewarded Video Ad

Load an ad before show it.

UnityMediation.loadRewardedAd(
  adUnitId: 'REWARDED_AD_UNIT_ID',
  onComplete: (adUnitId) => print('Rewarded Ad Load Complete $adUnitId'),
  onFailed: (adUnitId, error, message) => print('Rewarded Ad Load Failed $adUnitId: $error $message'),
);

Show a loaded rewarded ad.

UnityMediation.showRewardedAd(
  adUnitId: 'REWARDED_AD_UNIT_ID',
  onStart: (adUnitId) => print('Rewarded Ad $adUnitId started'),
  onClick: (adUnitId) => print('Rewarded Ad $adUnitId click'),
  onRewarded: (adUnitId, reward) => print('Rewarded Ad $adUnitId rewarded $reward'),
  onClosed: (adUnitId) => print('Rewarded Ad $adUnitId closed'),
  onFailed: (adUnitId, error, message) => print('Rewarded Ad $adUnitId failed: $error $message'),
);

5. Interstitial Ad

Interstitial Video Ad

Load an ad before show it.

UnityMediation.loadInterstitialAd(
    adUnitId: 'INTERSTITIAL_AD_UNIT_ID',
    onComplete: (adUnitId) => print('Interstitial Ad Load Complete $adUnitId'),
    onFailed: (adUnitId, error, message) => print('Interstitial Ad Load Failed $adUnitId: $error $message'),
);

Show a loaded interstitial ad.

UnityMediation.showInterstitialAd(
    adUnitId: 'INTERSTITIAL_AD_UNIT_ID',
    onStart: (adUnitId) => print('Interstitial Ad $adUnitId started'),
    onClick: (adUnitId) => print('Interstitial Ad $adUnitId click'),
    onClosed: (adUnitId) => print('Interstitial Ad $adUnitId closed'),
    onFailed: (adUnitId, error, message) => print('Interstitial Ad $adUnitId failed: $error $message'),
);

Donate

If you found this plugin helpful and would like to thank me:

Buy Me A Coffee PayPal

You might also like...

Admob Flutter plugin that shows banner ads using native platform views.

Admob Flutter plugin that shows banner ads using native platform views.

Looking for Maintainers. Unfortunately I haven't been able to keep up with demand for features and improvments. If you are interested in helping maint

Dec 3, 2022

Display images flutter - Simple app to display images in flutter

Display images flutter - Simple app to display images in flutter

Display Images In Flutter Simple app to display images in a flutter. In this dem

Jan 29, 2022

Create different mobile applications such as a social networking application and an online store, as well as a news application using Flutter

Develop-Different-Mobile-Applications Create Different Mobile Applications such as a social networking application and an online store, as well as a n

Jul 1, 2022

A CustomPaint example where we can draw with different colors and different stroke sizes

A CustomPaint example where we can draw with different colors and different stroke sizes

CustomPaint A CustomPaint example where we can draw with different colors and different stroke sizes. A Flutter application which runs on iOS, Android

Dec 27, 2021

The lightweight and powerful wrapper library for Twitter Ads API written in Dart and Flutter 🐦

TODO: Put a short description of the package here that helps potential users know whether this package might be useful for them. Features TODO: List w

Aug 26, 2022

PsTube - Watch and download videos without ads

PsTube - Watch and download videos without ads

PsTube - Formerly FluTube Watch and download videos without ads Features Beautiful user interface Lightweight and fast No Login Required Keep your lik

Dec 21, 2022

A Flutter App To Watch Anime Online With No Ads

A Flutter App To Watch Anime Online With No Ads

Tako Play A Mobile App to Watch Anime With No ADS !! . Please Do not put Tako-Pl

Dec 22, 2022

Easy-to-make native ads in flutter using AdMOB SDK.

native_admob_flutter Easy-to-make ads in Flutter with Google's AdMob SDK. English | Português Get started To get started with Native Ads for Flutter,

Dec 12, 2022

An easy way to add all google ads to your flutter app.

An easy way to add all google ads to your flutter app.

Google Ads An easy way to add all google ads to your flutter app. How to use it Add the google_mobile_ads package using flutter pub add google_mobile_

Sep 27, 2022
Comments
  • can not build success for ios

    can not build success for ios

    /flutter/.pub-cache/hosted/pub.dartlang.org/unity_mediation-0.0.2/ios/Classes/ErrorUtils.swift:8:15: error: type 'UMSLoadError' has no member 'none' case .none: ~^~~~ note: Using new build system note: Planning note: Build preparation complete note: Building targets in dependency order

    opened by shipinbaoku 1
  • FAILURE: Build failed with an exception [Received status code 502 from server: Bad Gateway]

    FAILURE: Build failed with an exception [Received status code 502 from server: Bad Gateway]

    I am trying to use the new version 0.1.0 of flutter_unity_mediation. While trying to build the apk file it went into errors

    FAILURE: Build failed with an exception.
    
    * What went wrong:
    Could not determine the dependencies of task ':app:lintVitalRelease'.
    > Could not resolve all artifacts for configuration ':app:debugRuntimeClasspath'.
       > Could not resolve com.unity3d.mediation:adcolony-adapter:0.5.0.
         Required by:
             project :app
          > Could not resolve com.unity3d.mediation:adcolony-adapter:0.5.0.
             > Could not get resource 'https://jcenter.bintray.com/com/unity3d/mediation/adcolony-adapter/0.5.0/adcolony-adapter-0.5.0.pom'.
                > Could not HEAD 'https://jcenter.bintray.com/com/unity3d/mediation/adcolony-adapter/0.5.0/adcolony-adapter-0.5.0.pom'. Received status code 502 from server: Bad Gateway
       > Could not resolve com.unity3d.mediation:applovin-adapter:0.5.0.
         Required by:
             project :app
          > Could not resolve com.unity3d.mediation:applovin-adapter:0.5.0.
             > Could not get resource 'https://jcenter.bintray.com/com/unity3d/mediation/applovin-adapter/0.5.0/applovin-adapter-0.5.0.pom'.
                > Could not HEAD 'https://jcenter.bintray.com/com/unity3d/mediation/applovin-adapter/0.5.0/applovin-adapter-0.5.0.pom'. Received status code 502 from server: Bad Gateway
       > Could not resolve com.unity3d.mediation:vungle-adapter:0.5.0.
         Required by:
             project :app
          > Could not resolve com.unity3d.mediation:vungle-adapter:0.5.0.
             > Could not get resource 'https://jcenter.bintray.com/com/unity3d/mediation/vungle-adapter/0.5.0/vungle-adapter-0.5.0.pom'.
                > Could not HEAD 'https://jcenter.bintray.com/com/unity3d/mediation/vungle-adapter/0.5.0/vungle-adapter-0.5.0.pom'. Received status code 502 from server: Bad Gateway
       > Could not resolve com.unity3d.mediation:facebook-adapter:0.5.0.
         Required by:
             project :app
          > Could not resolve com.unity3d.mediation:facebook-adapter:0.5.0.
             > Could not get resource 'https://jcenter.bintray.com/com/unity3d/mediation/facebook-adapter/0.5.0/facebook-adapter-0.5.0.pom'.
                > Could not HEAD 'https://jcenter.bintray.com/com/unity3d/mediation/facebook-adapter/0.5.0/facebook-adapter-0.5.0.pom'. Received status code 502 from server: Bad Gateway
       > Could not resolve com.unity3d.mediation:admob-adapter:0.5.0.
         Required by:
             project :app
          > Could not resolve com.unity3d.mediation:admob-adapter:0.5.0.
             > Could not get resource 'https://jcenter.bintray.com/com/unity3d/mediation/admob-adapter/0.5.0/admob-adapter-0.5.0.pom'.
                > Could not HEAD 'https://jcenter.bintray.com/com/unity3d/mediation/admob-adapter/0.5.0/admob-adapter-0.5.0.pom'. Received status code 502 from server: Bad Gateway
    
    * Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
    

    I even try to open up the adapter pom url and it went into 502 bad gateway. What solution regarding this problem?

    opened by flameblue59 0
  • Unhandled Exception: MissingPluginException(No implementation found for method init on channel com.rebeloid.unity_mediation)

    Unhandled Exception: MissingPluginException(No implementation found for method init on channel com.rebeloid.unity_mediation)

    Hi, I have followed all the guide stated. However, I have no idea why this error, happen. I have check the game id and also placement id correct.

    [VERBOSE-2:ui_dart_state.cc(198)] Unhandled Exception: MissingPluginException(No implementation found for method init on channel com.rebeloid.unity_mediation)
    #0      MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:165:7)
    <asynchronous suspension>
    #1      UnityMediation.initialize (package:unity_mediation/src/unity_mediation.dart:26:5)
    <asynchronous suspension>
    [VERBOSE-2:ui_dart_state.cc(198)] Unhandled Exception: MissingPluginException(No implementation found for method loadRewardedAd on channel com.rebeloid.unity_mediation)
    #0      MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:165:7)
    <asynchronous suspension>
    #1      UnityMediation._loadAd (package:unity_mediation/src/unity_mediation.dart:115:5)
    <asynchronous suspension>
    #2      UnityMediation.loadRewardedAd (package:unity_mediation/src/unity_mediation.dart:75:5)
    <asynchronous suspension>
    

    flutter doctor -v

    [✓] Flutter (Channel stable, 3.0.5, on macOS 12.1 21C52 darwin-arm, locale en-ID)
        • Flutter version 3.0.5 at /Users/bobbyjulian/Desktop/development/flutter
        • Upstream repository https://github.com/flutter/flutter.git
        • Framework revision f1875d570e (3 weeks ago), 2022-07-13 11:24:16 -0700
        • Engine revision e85ea0e79c
        • Dart version 2.17.6
        • DevTools version 2.12.2
    
    [✓] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1)
        • Android SDK at /Users/bobbyjulian/Library/Android/sdk
        • Platform android-32, build-tools 32.1.0-rc1
        • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
        • Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)
        • All Android licenses accepted.
    
    [✓] Xcode - develop for iOS and macOS (Xcode 13.2.1)
        • Xcode at /Applications/Xcode.app/Contents/Developer
        • CocoaPods version 1.11.3
    
    [✓] Chrome - develop for the web
        • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
    
    [✓] Android Studio (version 2021.2)
        • Android Studio at /Applications/Android Studio.app/Contents
        • Flutter plugin can be installed from:
          🔨 https://plugins.jetbrains.com/plugin/9212-flutter
        • Dart plugin can be installed from:
          🔨 https://plugins.jetbrains.com/plugin/6351-dart
        • Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)
    
    [✓] Connected device (3 available)
        • iPhone 13 (mobile) • B7AD2BEE-0851-41AA-9794-DD18D77E7105 • ios            • com.apple.CoreSimulator.SimRuntime.iOS-15-2 (simulator)
        • macOS (desktop)    • macos                                • darwin-arm64   • macOS 12.1 21C52 darwin-arm
        • Chrome (web)       • chrome                               • web-javascript • Google Chrome 103.0.5060.134
    
    [✓] HTTP Host Availability
        • All required HTTP hosts are available
    
    
    opened by flameblue59 0
  • Adcolony mediation not work

    Adcolony mediation not work

    Hi, would there be any way to test mediations? because I have configured adcolony but it seems not to work, no ads are shown and on the unity dashboard it is marked red. thanks

    opened by stoppimyse 0
Releases(0.1.0)
Owner
Pavel Zaichyk
Pavel Zaichyk
Google mobile ads applovin - AppLovin mediation plugin for Google Mobile Ads (Flutter).

AppLovin mediation plugin for Google Mobile Ads Flutter Google Mobile Ads Flutter mediation plugin for AppLovin. Use this package as a library depende

Taeho Kim 1 Jul 5, 2022
Flutter native ads - Show AdMob Native Ads use PlatformView

flutter_native_ads Flutter plugin for AdMob Native Ads. Compatible with Android and iOS using PlatformView. Android iOS Getting Started Android Androi

sakebook 64 Dec 20, 2022
Yukino lets you read manga or stream anime ad-free from multiple sources for free! Available for Windows, Linux, MacOS and Android.

Yukino Yukino lets you read manga or stream anime ad-free from multiple sources. The project's name "Yukino" meaning "Snow" named after the character

Yukino 204 Jan 6, 2023
UIWidget is a Unity Package which helps developers to create, debug and deploy efficient, cross-platform Apps.

⚠️ The main repository of UIWidgets has been moved to https://github.com/Unity-Technologies/com.unity.uiwidgets. Please visit the new site if you have

Unity Technologies 1.9k Dec 27, 2022
Rooftop - A photos and videos application which is able to show curated content from Pexel database on the press of a button

rooftop RoofTop is a photos and videos application which is able to show curated

null 2 Feb 7, 2022
Embeddable unity game engine view for Flutter.

flutter_unity_widget Flutter unity 3D widget for embedding unity in flutter. Now you can make awesome gamified features of your app in Unity and get i

Rex Raphael 1.7k Jan 8, 2023
An rx stream builder widget that is able to pre-populate a flutter StreamBuilder with data from an rx stream if the stream is either a value or a replay observable.

An rx stream builder widget that is able to pre-populate a flutter StreamBuilder with data from an rx stream if the stream is either a value or a replay observable. For example the RX stream is a BehaviorSubject or a ReplaySubject.

Jon Samwell 8 Jan 22, 2022
A mobile client for the public apis repository, 1400+ free apis to use able to be navigated through your phone :)

Public APIs mobile app Your assistant app that will help you discover and pick the next API for your next development project What it contains, you sa

Gwhyyy 4 Dec 25, 2022
Ironsource Flutter Mediation SDK

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

CNT INTERACTIVE 5 Jan 18, 2022
Flutter ticket pass - A Flutter Widget to display the details of a ticket/pass purchased by customers and display the details of the purchase

ticket_pass_package A Flutter package to display the purchase of a ticket/pass along with additional details such as list of buyers. The source code i

null 40 Aug 13, 2022