i have integrated Admob 3.11.1 in Unity 2017.2.0 project. I wanted to add Vungle 5.3.2 as another network in the mediation.
- I have configured Vungle's console with an custom interstitial placement and rewarded custom placement.
- Succesfully added the Vungle's placement references into Admob console (as a new ad source).
- Configured eCPM of Vungle to $100 so it get first in priority.
- Imported Admob 3.11.1 Unity plugin.
- Imported vungle .jars from Android export and placed them in Plugins/Android folder. Also tried placing them in Plugins/Android/GoogleMobileAdsPlugin/libs.
- Added Vungle manifest activities.
<application
android:icon="@drawable/app_icon"
android:label="@string/app_name"
android:theme="@android:style/Theme.NoTitleBar">
<activity
android:label="@string/app_name"
android:screenOrientation="fullSensor"
android:configChanges="keyboardHidden|orientation|screenSize|screenLayout|smallestScreenSize"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
android:name="com.vungle.publisher.VideoFullScreenAdActivity">
</activity>
<activity android:name="com.vungle.publisher.MraidFullScreenAdActivity"
android:configChanges="keyboardHidden|orientation|screenSize|screenLayout|smallestScreenSize"
android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen"/>
<activity android:name="com.vungle.publisher.FlexViewAdActivity"
android:configChanges="keyboardHidden|orientation|screenSize|screenLayout|smallestScreenSize"
android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen"/>
</application>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission
android:name="android.permission.WRITE_EXTERNAL_STORAGE"
android:maxSdkVersion="18"/>
<uses-permissio
android:name="android.permission.READ_EXTERNAL_STORAGE"
android:maxSdkVersion="18" />
- Load rewarded ad from script like this:
RewardBasedVideoAd rewardBasedVideo = RewardBasedVideoAd.Instance;
// Create an empty ad request.
AdRequest.Builder builder = new AdRequest.Builder();
// Add simulator test as default
builder.AddTestDevice(AdRequest.TestDeviceSimulator);
rewardBasedVideo.LoadAd(builder.Build(), "admob-rewarded-placement");
- I'm using proguard.. so i added the rules for Vungle:
# Vungle
-dontwarn com.vungle.**
-dontnote com.vungle.**
-keep class com.vungle.** { *; }
-keep class javax.inject.*
-dontwarn de.greenrobot.event.util.**
-dontwarn rx.internal.util.unsafe.**
-keepclassmembers class rx.internal.util.unsafe.*ArrayQueue*Field* {
long producerIndex;
long consumerIndex;
}
-keepclassmembers class rx.internal.util.unsafe.BaseLinkedQueueProducerNodeRef {
rx.internal.util.atomic.LinkedQueueNode producerNode;
}
-keepclassmembers class rx.internal.util.unsafe.BaseLinkedQueueConsumerNodeRef {
rx.internal.util.atomic.LinkedQueueNode consumerNode;
}
-keep class rx.schedulers.Schedulers { public static <methods>; }
-keep class rx.schedulers.ImmediateScheduler { public <methods>; }
-keep class rx.schedulers.TestScheduler { public <methods>; }
-keep class rx.schedulers.Schedulers { public static ** test(); }
-dontwarn com.moat.**
-keep class com.moat.** { public protected private *; }
-dontwarn okio.**
-dontwarn retrofit2.Platform$Java8
- Added Admob's Vungle adapter .aar in Plugins/Android folder.
When i want to show a rewarded ad, i allways get Admob ads or Unity ads (another network its being mediated). But i never get Vungle ads. What could i be missing?
I finally solved it. I was missing passing Vungle placement references when loading Admob ad.
I was also missing Vungle extras package. You can get it on Vungle tutorial about integration with Admob Tutorial