您好,我正在尝试统一实施 Admob,我已经使用 Admob 在此处https://developers.google.com/admob/android/test-ads提供的测试 ID 成功集成了横幅广告和插页式广告。但是我无法展示任何奖励视频广告。每当我调用 RewardedVidosAds 时,什么都没有显示,并且调试日志错误显示广告未准备好。这是我正在使用的以下代码:
using System.Collections;
using System.Collections.Generic;
using System;
using UnityEngine;
using GoogleMobileAds;
using GoogleMobileAds.Api;
public class AdManager: MonoBehaviour {
public RewardBasedVideoAd rewardBasedVideoAd;
private InterstitialAd fullAdmob;
private bool rewardBasedEventHandlersSet = false;
// reward initialized
public int scoreAmount = 100;
// Use this for initialization
void Start() {
//loading both rewarded and interstitial ads in start.
LoadRewardBasedAd();
//RequestFull ();
}
// Update is called once per frame
void Update() {
}
public void LoadRewardBasedAd() {
rewardBasedVideoAd = RewardBasedVideoAd.Instance;
//Test
AdRequest adRequest = new AdRequest.Builder()
.Build();
rewardBasedVideoAd.LoadAd(adRequest, "ca-app-pub-3940256099942544/5224354917");
}
public void ShowRewardBasedAd() {
if (rewardBasedVideoAd.IsLoaded()) {
Debug.Log("Showiung video");
rewardBasedVideoAd.Show();
} else Debug.Log("not ready");
}
}
我目前还没有调解我的视频广告这会导致问题吗?我读到如果您使用测试 AdId,您不需要调解您的广告。调用奖励视频广告时,我的 logcat 中也出现以下错误
无法实例化适配器 com.google.DummyAdapter 无法加载广告:3