Question by
palakvasoya · Sep 29, 2017 at 12:07 PM ·
unity 5
ads loaded but not display why
private void RequestRewardBasedVideo ()
{
MonoBehaviour.print ("Dude,,as,,as,as,as,as,as");
string adUnitId = "ca-app-pub-3940256099942544/5224354917";
#if UNITY_EDITOR
string adUnitId = "ca-app-pub-3940256099942544/7325402514";
#elif UNITY_ANDROID
string adUnitId = "ca-app-pub-3940256099942544/7325402514";
#elif UNITY_IPHONE
string adUnitId = "ca-app-pub-3940256099942544/7325402514";
#else
string adUnitId = "ca-app-pub-3940256099942544/7325402514";
#endif
InterstitialAd interstitial = new InterstitialAd (adUnitId);
RewardBasedVideoAd rewardBasedVideo = RewardBasedVideoAd.Instance;
AdRequest request = new AdRequest.Builder ().Build ();
// Create a 320x50 banner at the top of the screen.
BannerView bannerView = new BannerView (adUnitId, AdSize.Banner, AdPosition.Top);
// Create an empty ad request.
rewardBasedVideo.LoadAd (request, adUnitId);
interstitial.LoadAd (request);
bannerView.LoadAd (request);
bannerView.Show ();
//Show Ad
showAdd (rewardBasedVideo);
}
private void showAdd (RewardBasedVideoAd rewardBasedVideo)
{
if (rewardBasedVideo.IsLoaded ()) {
MonoBehaviour.print (",,as,as,as,as,as");
//Subscribe to Ad event
//rewardBasedVideo.OnAdRewarded += HandleRewardBasedVideoRewarded;
rewardBasedVideo.Show ();
}
}
Comment