How to use VungleAdNetworkExtras class for Vungle iOS?

519 views
Skip to first unread message

Toby Ye

unread,
Oct 28, 2017, 10:17:15 AM10/28/17
to Google Mobile Ads SDK Developers
Hi dear,

I use GoogleMobileAds 3.8 and Vungle sdk 5.3. 
In the Document it said add the following code:
GADRequest *request = [GADRequest request];
VungleAdNetworkExtras *extras = [[VungleAdNetworkExtras alloc] init];

NSMutableArray *placements = [[NSMutableArray
    alloc
]initWithObjects:@"PLACEMENT_ID_1", @"PLACEMENT_ID_2", nil];
extras
.allPlacements = placements;
[request registerAdNetworkExtras:extras];
[_interstitial loadRequest:request];
But I don't know where to put this code in? 
I found 2 file on GitHub googleads-mobile-unity/mediation/Vungle/source/plugin/Assets/Plugins/iOS/VungleExtrasBuilder.h and VungleExtrasBuilder.m
But still not sure where to put the file and where to put my Vungle Placement ID?

Thank you!
Toby


Joshua Lagonera (Mobile Ads SDK Team)

unread,
Oct 30, 2017, 1:43:13 AM10/30/17
to Google Mobile Ads SDK Developers
Hi Toby,

To mediate with Vungle and supply the required placement IDs, you would need to import the Vungle folder into your project under the Plugins > GoogleMobileAds > Api > Mediation folder.

After importing the Vungle Mediation folder into your project, you would have to include the placement IDs in your Ad Request in your code, as shown below:

  // Import the files
 
using GoogleMobileAds.Api.Mediation.Vungle;

 
private AdRequest CreateAdRequest() {
   
// Add your placement IDs in a string array
   
string[] placements = new string[]{"MY_PLACEMENT_ID_1","MY_PLACEMENT_ID_2"};

   
// Create the Extra. Note that there is an extra for both Interstitial and Rewarded Video.
   
VungleMediationExtras extras = new VungleRewardedVideoMediationExtras();
    extras
.
SetAllPlacements (placements);

   
// Create the Ad Request
   
return new AdRequest.Builder()
                       
.AddMediationExtras(extras)
                       
.Build();
 
}

Let me know if you have any more questions.

Regards,
Joshua Lagonera
Mobile Ads SDK Team

Toby Ye

unread,
Oct 30, 2017, 1:55:16 AM10/30/17
to Google Mobile Ads SDK Developers
Thank you !
Is it for both ios and android platform?

Toby Ye

unread,
Oct 30, 2017, 2:30:36 AM10/30/17
to Google Mobile Ads SDK Developers
I just import the jungle folder, but got errors:
Assets/Plugins/GoogleMobileAds/Api/Mediation/Vungle/VungleMediationExtras.cs(6,51): error CS0246: The type or namespace name `MediationExtras' could not be found. Are you missing an assembly reference?
Assets/Plugins/GoogleMobileAds/Api/Mediation/Vungle/VungleMediationExtras.cs(16,32): error CS0115: `GoogleMobileAds.Api.Mediation.Vungle.VungleMediationExtras.IOSMediationExtraBuilderClassName' is marked as an override but no suitable property found to override
Assets/Plugins/GoogleMobileAds/Api/Mediation/Vungle/VungleInterstitialMediationExtras.cs(10,32): error CS0115: `GoogleMobileAds.Api.Mediation.Vungle.VungleInterstitialMediationExtras.AndroidMediationExtraBuilderClassName' is marked as an override but no suitable property found to override
Assets/Plugins/GoogleMobileAds/Api/Mediation/Vungle/VungleRewardedVideoMediationExtras.cs(10,32): error CS0115: `GoogleMobileAds.Api.Mediation.Vungle.VungleRewardedVideoMediationExtras.AndroidMediationExtraBuilderClassName' is marked as an override but no suitable property found to override

在 2017年10月30日星期一 UTC+8下午1:43:13,Joshua Lagonera (Mobile Ads SDK Team)写道:

Joshua Lagonera (Mobile Ads SDK Team)

unread,
Oct 30, 2017, 5:20:21 AM10/30/17
to Google Mobile Ads SDK Developers
Hi Toby,

Since it is added in the Unity Project itself, then it will apply to both Android and iOS platforms. However, your more recent error suggests that you are missing some files when you imported the Plugin in your project, namely the MediationExtras class.

Would you be able to provide us a sample project where the issue can be replicated for us to assist you further?

Regards,
Joshua Lagonera
Mobile Ads SDK Team

Joshua Lagonera (Mobile Ads SDK Team)

unread,
Nov 8, 2017, 6:42:07 AM11/8/17
to Google Mobile Ads SDK Developers
Hi Toby,

Hope you are doing well. 

Are you still having issues with mediating with Vungle? If you still are and would want further assistance from us, then please provide to us a sample project so we may be able to assist you. You may use the Reply privately to author option if you are not comfortable sharing your project in public.

Regards,
Joshua Lagonera
Mobile Ads SDK Team

Toby Ye

unread,
Dec 17, 2017, 11:22:23 PM12/17/17
to Google Mobile Ads SDK Developers
Hi Joshua,
Thank you for your help, it works after I import all MediationExtras file to the project!
But there is an issue after I update unity 2017.1.0f3 to 2.1.7.2.0p3. The vungle don't show on ios and log :"At least one placement should be specified!". But I didn't change the code to setup placements.

Toby

Joshua Lagonera (Mobile Ads SDK Team)

unread,
Dec 18, 2017, 3:40:37 AM12/18/17
to Google Mobile Ads SDK Developers
Hi Toby,

Glad you were able to make it work!

As for your issue, the version of Unity should not have any effect on the Plugin. Make sure that you are using VungleRewardedVideoMediationExtras() to request for Rewarded Video Ads from Vungle, and VungleInterstitialMediationExtras() for Interstitial Ads.

That said, can you try re-importing the official plugin, as well as the MediationExtras classes and see if you can still reproduce the issue? Can you also provide to us a sample project where we can replicate the issue using the Reply Privately to Author option?

Regards,
Joshua Lagonera
Mobile Ads SDK Team

Joshua Lagonera (Mobile Ads SDK Team)

unread,
Dec 22, 2017, 3:34:05 AM12/22/17
to Google Mobile Ads SDK Developers
Hi Toby,

Hope you are doing well this holiday season.

I'm just reaching out to you to ask if you are still having issues with mediating with Vungle, even after trying to re-import the plugin. Kindly let us know if you would still need assistance from our end.

Regards,
Joshua Lagonera
Mobile Ads SDK Team

Reply all
Reply to author
Forward
0 new messages