Android AdMob ad don';t秀(团结)
当我使用unity时,控制台显示Dummy LoadAD、Dummy Show等。 但当我在手机上测试时,它确实会显示任何广告。 我在两个按钮上设置了这两个功能。bannerAD按钮不显示bannerAD。videoAD按钮将关闭我的应用程序 这是我的密码Android AdMob ad don';t秀(团结),android,unity3d,admob,Android,Unity3d,Admob,当我使用unity时,控制台显示Dummy LoadAD、Dummy Show等。 但当我在手机上测试时,它确实会显示任何广告。 我在两个按钮上设置了这两个功能。bannerAD按钮不显示bannerAD。videoAD按钮将关闭我的应用程序 这是我的密码 我是否做错了什么,或者设置了Admob的需求?Admob不会在Unity Editor上显示任何广告。您应该始终通过在手机上构建和测试来测试与广告相关的内容。AdMob不会在Unity Editor上显示任何广告。您应该始终通过在手机上构建和
我是否做错了什么,或者设置了Admob的需求?Admob不会在Unity Editor上显示任何广告。您应该始终通过在手机上构建和测试来测试与广告相关的内容。AdMob不会在Unity Editor上显示任何广告。您应该始终通过在手机上构建和测试来测试与广告相关的内容。确保您的AdMob帐户获得批准。如果您刚刚在AdMob上创建了项目,则可能需要24小时才能显示广告。我的帐户已注册48小时,即使我使用AdMob的演示ID,也无法显示ADMake。请确保您的AdMob帐户已获得批准。如果你刚刚在AdMob上创建了项目,可能需要24小时才能显示广告。我的帐户已注册48小时,即使我使用AdMob的演示ID,它也无法显示广告
using UnityEngine;
using GoogleMobileAds.Api;
using System;
using UnityEngine.UI;
public class admanageger : MonoBehaviour
{
public Text adstatus;
BannerView bannerView;
RewardedAd rewardedAd;
string appID = "ca-app-pub-#####~#####";
// Start is called before the first frame update
private void Awake()
{
}
void Start()
{
MobileAds.Initialize(appID);
}
public void showbannerAD()
{
#if UNITY_ANDROID
string adUnitId = "ca-app-pub-####/####";
#elif UNITY_IPHONE
string adUnitId = "ca-app-pub-###/#####";
#else
string adUnitId = "unexpected_platform";
#endif
// Create a 320x50 banner at the top of the screen.
this.bannerView = new BannerView(adUnitId, AdSize.Banner, AdPosition.Top);
// Create an empty ad request.
AdRequest request = new AdRequest.Builder().Build();
// Load the banner with the request.
this.bannerView.LoadAd(request);
}
public void showvideoAD()
{
#if UNITY_ANDROID
string adUnitId = "ca-app-pub-#####/####";
#elif UNITY_IPHONE
string adUnitId = "ca-app-pub-#####/#####";
#else
string adUnitId = "unexpected_platform";
#endif
this.rewardedAd = new RewardedAd(adUnitId);
// Create an empty ad request.
AdRequest request = new AdRequest.Builder().Build();
// Load the rewarded ad with the request.
this.rewardedAd.LoadAd(request);
this.rewardedAd.Show();
}
}