UnityでAdMobのインタースティシャル広告を実装する方法を教えていただきたいです。
公式のソースコードをコピペしたのですが、表示がされませんでした。
C#
1using GoogleMobileAds.Api; 2using System.Collections; 3using UnityEngine; 4 5public class AdMobScript : MonoBehaviour 6{ 7 private void RequestInterstitial() 8 { 9#if UNITY_ANDROID 10 string adUnitId = "実際は入力してあります"; 11#elif UNITY_IPHONE 12 string adUnitId = "INSERT_IOS_INTERSTITIAL_AD_UNIT_ID_HERE"; 13#else 14 string adUnitId = "unexpected_platform"; 15#endif 16 17 // Initialize an InterstitialAd. 18 InterstitialAd interstitial = new InterstitialAd(adUnitId); 19 // Create an empty ad request. 20 AdRequest request = new AdRequest.Builder().Build(); 21 // Load the interstitial with the request. 22 interstitial.LoadAd(request); 23 } 24}
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。