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...

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

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

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

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

Sep 17, 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

Sep 20, 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,

Sep 14, 2022

Mangato - An Android & IOS app to read manga on your phone without ads.

Mangato - An Android & IOS app to read manga on your phone without ads.

Mangato Read your favorite Japanese manga on Mangato including Attack on Titan, Fairy Tail, The Seven Deadly Sins, Fuuka, One Piece, and more. WARNING

Sep 21, 2022

A Flutter plugin for IOS and Android providing a simple way to display PDFs.

A Flutter plugin for IOS and Android providing a simple way to display PDFs.

Pdf Viewer Plugin A Flutter plugin for IOS and Android providing a simple way to display PDFs. Features: Display PDF. Installation First, add pdf_view

Jun 23, 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
  • 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.0.6)
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 63 May 25, 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 193 Sep 12, 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
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 Sep 19, 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.6k Sep 13, 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
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
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
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

Kevin McGill 416 Sep 18, 2022