【发布时间】:2021-10-15 06:25:31
【问题描述】:
我正在尝试使用 admob 实施 Unity 广告中介。我已按照此处的说明进行操作:https://developers.google.com/admob/unity/mediation/unity 和 https://developers.google.com/admob/unity/mediate 但即使在 4 天后 Unity Ads 仍显示为 cant retrieve data. 这可以在下面的屏幕截图中看到:
可以看出,我得到了匹配率,但除此之外没有别的。
根据上述链接中的说明,我已在Start() 中使用以下内容初始化了我的 sdk
// Initialize the Mobile Ads SDK.
MobileAds.Initialize((initStatus) =>
{
Dictionary<string, AdapterStatus> map = initStatus.getAdapterStatusMap();
foreach (KeyValuePair<string, AdapterStatus> keyValuePair in map)
{
string className = keyValuePair.Key;
AdapterStatus status = keyValuePair.Value;
switch (status.InitializationState)
{
case AdapterState.NotReady:
// The adapter initialization did not complete.
MonoBehaviour.print("Adapter: " + className + " not ready.");
break;
case AdapterState.Ready:
// The adapter was successfully initialized.
MonoBehaviour.print("Adapter: " + className + " is initialized.");
break;
}
}
});
当使用adb logcat 时,我可以看到两者都按照以下输出进行了初始化:
08-11 20:29:58.961 6777 6865 I Unity : Logged in successfully!
08-11 20:29:58.961 6777 6865 I Unity : System.Action`1:Invoke(T)
08-11 20:29:58.961 6777 6865 I Unity : System.Action`2:Invoke(T1, T2)
08-11 20:29:58.961 6777 6865 I Unity : System.Action`1:Invoke(T)
08-11 20:29:58.961 6777 6865 I Unity : System.Action`1:Invoke(T)
08-11 20:29:58.961 6777 6865 I Unity : System.Action:Invoke()
08-11 20:29:58.961 6777 6865 I Unity : GooglePlayGames.OurUtils.PlayGamesHelperObject:Update()
08-11 20:29:58.961 6777 6865 I Unity :
08-11 20:29:58.961 6777 6865 I Unity : [Play Games Plugin 0.10.09] 08/11/21 20:29:58 +01:00 DEBUG: Authentication succeeded
08-11 20:29:58.961 6777 6865 I Unity : System.Action:Invoke()
08-11 20:29:58.961 6777 6865 I Unity : GooglePlayGames.OurUtils.PlayGamesHelperObject:Update()
08-11 20:29:58.961 6777 6865 I Unity :
08-11 20:29:59.254 6777 6777 I Unity : ~~~~~~~~~~~~~~~~~~~ Adapter: com.google.android.gms.ads.MobileAds is initialized. ~~~~~~~~~~~~~~~~~~~
08-11 20:29:59.254 6777 6777 I Unity : <>c:<Awake>b__66_0(InitializationStatus)
08-11 20:29:59.254 6777 6777 I Unity : System.Action`1:Invoke(T)
08-11 20:29:59.254 6777 6777 I Unity : System.Action`1:Invoke(T)
08-11 20:29:59.254 6777 6777 I Unity : System.Reflection.MonoMethod:Invoke(Object, BindingFlags, Binder, Object[], CultureInfo)
08-11 20:29:59.254 6777 6777 I Unity : UnityEngine.AndroidJavaProxy:Invoke(String, Object[])
08-11 20:29:59.254 6777 6777 I Unity : UnityEngine._AndroidJNIHelper:InvokeJavaProxyMethod(AndroidJavaProxy, IntPtr, IntPtr)
08-11 20:29:59.254 6777 6777 I Unity :
08-11 20:29:59.255 6777 6777 I Unity : ~~~~~~~~~~~~~~~~~~~ Adapter: com.google.ads.mediation.unity.UnityMediationAdapter is initialized. ~~~~~~~~~~~~~~~~~~~
08-11 20:29:59.255 6777 6777 I Unity : <>c:<Awake>b__66_0(InitializationStatus)
08-11 20:29:59.255 6777 6777 I Unity : System.Action`1:Invoke(T)
08-11 20:29:59.255 6777 6777 I Unity : System.Action`1:Invoke(T)
08-11 20:29:59.255 6777 6777 I Unity : System.Reflection.MonoMethod:Invoke(Object, BindingFlags, Binder, Object[], CultureInfo)
08-11 20:29:59.255 6777 6777 I Unity : UnityEngine.AndroidJavaProxy:Invoke(String, Object[])
08-11 20:29:59.255 6777 6777 I Unity : UnityEngine._AndroidJNIHelper:InvokeJavaProxyMethod(AndroidJavaProxy, IntPtr, IntPtr)
08-11 20:29:59.255 6777 6777 I Unity :
08-11 20:30:03.899 6777 7745 I Unity : HandleRewardedAdLoaded event received and Reward Ad loaded!
任何人都可以就如何解决这个问题提供任何建议吗?
【问题讨论】:
标签: unity3d admob mobile-ad-mediation