Admob is not showing ads on final apk build to test even i put the test ad units id and add a test device .
I don t know what to do now .
public void Start()
{
List deviceIds = new List();
deviceIds.Add("17a4e1d5-f681-489e-96a7-92f50b1b9898");
RequestConfiguration requestConfiguration = new RequestConfiguration
.Builder()
.SetTestDeviceIds(deviceIds)
.build();
MobileAds.SetRequestConfiguration(requestConfiguration);
MobileAds.Initialize(initStatus => { });
this.rewardedAd = new RewardedAd(adUnitId);
RequestRewardedVideo();
}
public void RequestRewardedVideo()
{
// Called when an ad request has successfully loaded.
this.rewardedAd.OnAdLoaded += HandleRewardedAdLoaded;
// Called when an ad request failed to load.
// Called when an ad is shown.
this.rewardedAd.OnAdOpening += HandleRewardedAdOpening;
// Called when an ad request failed to show.
this.rewardedAd.OnAdFailedToShow += HandleRewardedAdFailedToShow;
// Called when the user should be rewarded for interacting with the ad.
this.rewardedAd.OnUserEarnedReward += HandleUserEarnedReward;
// Called when the ad is closed.
this.rewardedAd.OnAdClosed += HandleRewardedAdClosed;
AdRequest request = new AdRequest.Builder().Build();
this.rewardedAd.LoadAd(request);
}
public void UserChoseToWatchAd()
{
if (this.rewardedAd.IsLoaded())
{
this.rewardedAd.Show();
}
}
public void HandleRewardedAdLoaded(object sender, EventArgs args)
{
Debug.Log("Rewarded Ad Is Ready");
}
public void HandleRewardedAdFailedToLoad(object sender, AdErrorEventArgs args)
{
RequestRewardedVideo();
}
public void HandleRewardedAdOpening(object sender, EventArgs args)
{
}
public void HandleRewardedAdFailedToShow(object sender, AdErrorEventArgs args)
{
RequestRewardedVideo();
}
public void HandleRewardedAdClosed(object sender, EventArgs args)
{
RequestRewardedVideo();
}
public MoneyMNG Money;
public void HandleUserEarnedReward(object sender, Reward args)
{
PlayerPrefs.SetInt("Money", PlayerPrefs.GetInt("Money")+15000);
Money.Update2();
}
↧