using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using GoogleMobileAds.Api;public class AdsManager : MonoBehaviour { private BannerView bannerView;
void Start() {
#if UNITY_ANDROID
string appid = "ca-app-pub-7067959384271293~3288350070";
#else
string appid = "unexpected_platform";
#endif
MobileAds.Initialize(appid);
RequestBanner();
} void RequestBanner() {
#if UNITY_ANDROID
string adunitid = GameManager.IsDebug ? "ca-app-pub-3940256099942544/6300978111" : "ca-app-pub-7067959384271293/2593505069";
#else
string adunitid = "unexpected_platform";
#endif
bannerView = new BannerView(adunitid, AdSize.SmartBanner, AdPosition.Bottom);
AdRequest request = new AdRequest.Builder().Build();
bannerView.LoadAd(request);
} void OnApplicationQuit() {
bannerView.Destroy();
}
}
Hello! I'm expecting a problem with my Google Ads. I set the ads in my game and it's been a while after I registered my AdMob account.The ads work when the 'Development Build' is checked in build settings, but don't if not.The app is here: https://play.google.com/store/apps/details?id=com.alt3r3d.tapThe code for ads is here:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using GoogleMobileAds.Api;public class AdsManager : MonoBehaviour {private BannerView bannerView;
void Start() {
#if UNITY_ANDROID
string appid = "ca-app-pub-7067959384271293~3288350070";
#else
string appid = "unexpected_platform";
#endif
MobileAds.Initialize(appid);
RequestBanner();
}
void RequestBanner() {
#if UNITY_ANDROID
string adunitid = GameManager.IsDebug ? "ca-app-pub-3940256099942544/6300978111" : "ca-app-pub-XXXXXXXXX/XXXXXXXXXXX";
#else
string adunitid = "unexpected_platform";
#endif
bannerView = new BannerView(adunitid, AdSize.SmartBanner, AdPosition.Bottom);
AdRequest request = new AdRequest.Builder().Build();
bannerView.LoadAd(request);
}
void OnApplicationQuit() {
bannerView.Destroy();
}
}
I hope you can help with something.
--
---
You received this message because you are subscribed to the Google Groups "Google Mobile Ads SDK Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-admob-ads-sdk+unsub...@googlegroups.com.
To post to this group, send email to google-admob-ads-sdk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-admob-ads-sdk/dd9a78a3-668b-44ab-b52c-49554254ece6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.