Question by
timbelion101 · Apr 14, 2018 at 09:57 PM ·
androidadsappshow
AdMob awarded ad not showing.
I am doing some simple app with two buttons... first button is sending request for Awarded (test) ad and then second shows the ad.
Here is my code:
using GoogleMobileAds.Api;
using UnityEngine;
using System;
public class adManager : MonoBehaviour
{
RewardBasedVideoAd rewardedAd;
public void Start()
{
rewardedAd = RewardBasedVideoAd.Instance;
requestVideo();
}
public void requestVideo()
{
Debug.Log("Video Requested!");
string adID = "My ad ID";
AdRequest request = new AdRequest.Builder()
.AddTestDevice(AdRequest.TestDeviceSimulator) // Simulator.
.AddTestDevice("BD6E7C35B6F8FA70") // My test device.
.Build();
rewardedAd.LoadAd(request, adID);
}
public void showBannerAd()
{
if (rewardedAd.IsLoaded())
{
Debug.Log("AdAvailible!");
rewardedAd.OnAdRewarded += HandleOnAdRewarded;
rewardedAd.Show();
}
else
{
Debug.Log("AdNotAvailible!");
}
}
public void HandleOnAdRewarded(object sender, EventArgs args)
{
Debug.Log("You are rewarded!");
}
public event EventHandler<Reward> OnAdRewarded;
}
Is something wrong with my code or something else? I tried interstitial and banner ad and they WORKED.
Thanks for help.
Comment
Your answer
Follow this Question
Related Questions
Admob ad intergration problem to android game..... 0 Answers
Having trouble with unity ads in android 5.0 0 Answers
UnityPlayer packaged as an Android library module? 0 Answers
Test ad still showing up. 1 Answer
Frame Drop After Advertisement 2 Answers