Quantcast
Channel: Questions in topic: "ads"
Viewing all articles
Browse latest Browse all 1416

AdMob awarded ad not showing.

$
0
0
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 OnAdRewarded; } Is something wrong with my code or something else? I tried interstitial and banner ad and they WORKED. Thanks for help.

Viewing all articles
Browse latest Browse all 1416

Trending Articles