Rewarded videos not working on Unity

1,568 views
Skip to first unread message

Ronaldo Manfredini

unread,
Jan 4, 2017, 10:35:36 AM1/4/17
to Google Mobile Ads SDK Developers
Hi!

I tried to implement Admob rewarded videos, using the following script:



public class GameAdvertisement : MonoBehaviour
{
   
   
public SaveLoad saveReference;
   
private RewardBasedVideoAd rewardBasedVideo;
   
public AdRequest request;
   
private string adUnitId = "ca-app-pub-2431865456328128/8772653896";
   
private bool rewardBasedEventHandlersSet;
   
void Start()
   
{
       
RequestRewardBasedVideo();
     
       
   
}

   
//Admob

     
private void RequestRewardBasedVideo()
     
{    
         rewardBasedVideo
= RewardBasedVideoAd.Instance;
         request
= new AdRequest.Builder().Build();
         rewardBasedVideo
.LoadAd(request, adUnitId);
         rewardBasedEventHandlersSet
= false;
     
}

     
public void ShowAdmobRVideo() //this is the method attached to my "Watch Video" button
     
{
         
if (rewardBasedVideo.IsLoaded())
         
{
             rewardBasedVideo
.Show();
             rewardBasedEventHandlersSet
= true;
         
}
         
if (!rewardBasedVideo.IsLoaded())
         
{
             rewardBasedVideo
.LoadAd(request, adUnitId);
         
}
         
if (!rewardBasedEventHandlersSet)
         
{        
             rewardBasedVideo
.OnAdRewarded += HandleRewardBasedVideoRewarded;          
             rewardBasedEventHandlersSet
= true;
         
}

     
}
     
public void HandleRewardBasedVideoRewarded(object sender, Reward args)
     
{
         
string type = args.Type;
         
double amount = args.Amount;
         
print("User rewarded with: " + amount.ToString() + " " + type);
         saveReference
.playerLifes += 5; //this is the place where the reward should be added. Not sure if this line should be here or somewhere else
     
}
     

   
}




The problem is that when I click the button that haves the ShowAdmobRVideo() method attached to it, the video don't show up on my Android device, and I don't receive my 5 Lifes reward as expected.
I'm almost pretty sure that my code is all ok because in the game console all the dummies are showing up (will post a print of the log for better understanding) and in the Admob dashboard I have 180+ Admob Network requests, but no impressions have been counted at all.
Please help! It's the only thing I need to set up before posting my game and I'm stuck on this for days!

PS: the error in the top of the log has nothing related to the actual problem. I have already solved it but I still can't see the video ads.
print05.jpg

Ronaldo Manfredini

unread,
Jan 4, 2017, 10:45:57 AM1/4/17
to Google Mobile Ads SDK Developers
Also, the plugin versions and software that I'm using are:

Unity v5.4.3f1

Google Mobile Ads Unity v3.1.3 (also tried to downgrade and it didn't worked)

Google Play Services 0.9.36

Test Device: Android 5.0


Veer Arjun Busani(Mobile Ads SDK Team)

unread,
Jan 4, 2017, 12:46:31 PM1/4/17
to Google Mobile Ads SDK Developers
Hi Ronaldo,
  • Can you first make sure that you have updated your Android SDK Build Tools and Google Play Services frameworks from your Android SDK Manager
    • From you screenshot, it looks like these dependencies are missing from your system. 
  • Next, your Ad Unit ID does not seem to have any mediation networks in its stack. Reward Video ads are currently only supported via third party ad networks and you can find the list here.
  • You need to select and register from any of those supported networks and then, from your AdMob dashboard, add those networks into your mediation stack.
    • Note that each ad network would provide an unique set of IDs that you need to use to configure your Ad Unit ID.
  • Once your Ad Unit ID is properly configured, along with our Mobile Ads Unity plugin, you also need to copy the selected ad network's SDK and Adaptor, both of which can be found here.
    • Note if the SDK or the Adaptor is a JAR file, it must go into Assets > Plugins > Android > GoogleMobileAds > libs folder and if it's an AAR file, copy it into Assets > Plugins > Android folder.
    • Also, if the SDK is a JAR file, you would also have to declare the mediation network's activity in the Manifest (Assets > Plugins > Android > GoogleMobileAds).
Finally, here is a sample app that comes with most of the mediation ad networks integrated that you can test with.

Thanks,
Arjun Busani
Mobile Ads SDK Team

Ronaldo Manfredini

unread,
Jan 7, 2017, 8:22:38 PM1/7/17
to Google Mobile Ads SDK Developers
Hi Arjun,

I have updated my Android SDK Build Tools and Google Play Services in the SDK Manager. I will put prints of some steps that I have done that can be relevant to the case.
Also have set up some Ad Networks like Unity Ads and AdColony in the AdMob dashboard, have imported the adapters and declared the mediation in the Manifest.
But after all that I still can't see any video ads. I noticed that in the AdMob dashboard the ad network mediation status was Pendent, and I think this is the reason why I can't see any ads.
I have searched through the Internet but found nothing related to this pendent "issue". Any ideas on what I can do to solve this?

Thanks,
Ronaldo Manfredini
print06.jpg
print07.jpg
print08.jpg

Veer Arjun Busani(Mobile Ads SDK Team)

unread,
Jan 9, 2017, 10:59:20 AM1/9/17
to Google Mobile Ads SDK Developers
Hi Ronaldo,

I was able to load ads using your Ad Unit ID. It usually take a few hours for any updates to be reflected from your AdMob dashboard. I would suggest you to try again from the previously linked sample app and let us know.

Thanks,
Arjun Busani
Mobile Ads SDK Team

Ronaldo Manfredini

unread,
Jan 10, 2017, 5:31:28 AM1/10/17
to google-adm...@googlegroups.com
Hi Arjun,

Thanks for all the help! It's working perfectly!

Ronaldo Manfredini



--

---
You received this message because you are subscribed to a topic in the Google Groups "Google Mobile Ads SDK Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-admob-ads-sdk/ea8lE5l2z5I/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-admob-ads-sdk+unsub...@googlegroups.com.
To post to this group, send email to google-admob-ads-sdk@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages