前提・実現したいこと
Unityを用いてAndroid用にアプリを作成し、AdMobを用いて広告を表示したいと思い、一度広告のみを表示するアプリを作成しようとしました。
発生している問題・エラーメッセージ
ビルドは成功するのですが、広告が表示されません。
該当のソースコード
C#
1using System.Collections; 2using System.Collections.Generic; 3using UnityEngine; 4 5using GoogleMobileAds.Api; 6 7 8public class GMADS : MonoBehaviour { 9 10 public static BannerView bannerView; 11 12 // Use this for initialization 13 void Start () { 14 string appId = "ca-app-pub-3940256099942544~3347511713";//サンプルに掲載されていたテスト用アプリID 15 16 // Initialize the Google Mobile Ads SDK. 17 MobileAds.Initialize(appId); 18 19 this.RequestBanner(); 20 } 21 22 private void RequestBanner() 23 { 24 string adUnitId = "ca-app-pub-3940256099942544/6300978111";//サンプルに記載さてれいたテスト用広告ユニットID 25 26 // Create a 320x50 banner at the top of the screen. 27 bannerView = new BannerView(adUnitId, AdSize.Banner, AdPosition.Top); 28 // Create an empty ad request. 29 AdRequest request = new AdRequest.Builder().Build(); 30 31 // Load the banner with the request. 32 bannerView.LoadAd(request); 33 } 34 35 // Update is called once per frame 36 void Update () { 37 38 } 39}
試したこと
Admob公式の"スタートガイド"及び"バーナー広告"の広告を読み込むまでを実行しただけのプログラムです。
2日ほどインターネットに載っている情報を探し漁りましたが、有効な解決策にたどり着くことが出来ませんでした。
補足情報(FW/ツールのバージョンなど)
Unity : 2018.1.9f2
Visual Studio : Community 2017 Version 15.8.4
AdMob : Google Mobile Ads Unity Plugin v3.17
テスト用端末 : Android8.0.0
回答1件
あなたの回答
tips
プレビュー