###前提・実現したいこと
AndroidでAdMobでインタースティシャル広告の表示を試しているのですが、
下記ソースでテスト広告は表示されるのに、本番用に切り替えると広告が表示されなくなります。
設定しているアプリがAdMobでペナルティを課せられているのかと思ったのですが
そもそもまだGoogle Playに公開していないアプリですし、心当たりはなく、
また、同じそのアプリでバナー広告は本番用も表示されます。
ご教授いただけないでしょうか?
###該当のソースコード
C#
1using System.Collections; 2using System.Collections.Generic; 3using UnityEngine; 4using GoogleMobileAds.Api; 5 6public class AdMob : MonoBehaviour { 7 8 9 private InterstitialAd _interstitial; 10 11 void Start () { 12 RequestInterstitial (); 13 14 Invoke("showInterstitial", 8); 15 } 16 17 public void showInterstitial() 18 { 19 if (_interstitial != null && _interstitial.IsLoaded()) 20 { 21 _interstitial.Show(); 22 } 23 } 24 25 public void RequestInterstitial() 26 { 27 28 string adUnitId = "XXXX(実際は値を入れてます)"; 29 30 _interstitial = new InterstitialAd (adUnitId); 31 #if TEST 32 AdRequest request = new AdRequest.Builder ().AddTestDevice("XXXX(実際は値を入れてます)").Build (); 33 #elif RELEASE 34 AdRequest request = new AdRequest.Builder ().Build (); 35 #endif 36 _interstitial.LoadAd (request); 37 } 38 39 void HandleAdClosed (object sender, System.EventArgs e) 40 { 41 _interstitial.Destroy (); 42 } 43 44}
しばらくたてば表示されたのではないでしょうか
ご回答ありがとうございます。原因不明ですが、直りました。昨日はしばらく待っても表示されなかったのですが、今日は表示されました。
回答1件
あなたの回答
tips
プレビュー