- Home /
Question by
silvio118 · Jul 22, 2019 at 02:12 PM ·
adsadmobadvertising
why my code don't work? why don't i view nothing??? i use 26 Api and have changed the androidManifest ( name, id , internet access)
using System.Collections; using System.Collections.Generic; using UnityEngine; using GoogleMobileAds; using GoogleMobileAds.Api; using System;
public class AdMobManager : MonoBehaviour {
//ca-app-pub-7856710793772811~1099871283
private string APP_ID = "Mio Id AdMob";
private BannerView bannerAD;
private InterstitialAd interstitialAd;
private RewardBasedVideoAd rewardVideoAd;
// Start is called before the first frame update
void Start()
{
MobileAds.Initialize(APP_ID);
this.RequestBanner();
this.RequestInterstitial();
}
public void RequestBanner() {
string banner_ID = "ca-app-pub-3940256099942544/6300978111";
AdRequest adrequest = new AdRequest.Builder().Build();
bannerAD = new BannerView(banner_ID, AdSize.SmartBanner, AdPosition.Top);
bannerAD.LoadAd(adrequest);
//bannerAD.Show();
}
public void RequestInterstitial() {
string interstitial_ID = "ca-app-pub-3940256099942544/1033173712";
interstitialAd = new InterstitialAd(interstitial_ID);
AdRequest adRequest = new AdRequest.Builder().Build();
interstitialAd.LoadAd(adRequest);
interstitialAd.Show();
}
}
Comment