我不确定我是否正确设置了事件回调,这些事件会在哪里触发?我已经设置了测试广告,所有不同类型的广告都可以正常工作。
我有一个游戏对象 UI_Menu 和我的监听器,就像这样
AppLovin.SetUnityAdListener("UI_Menu");
但是没有一个事件被触发
public void ShowInterstitial()
{
Log("Showing interstitial ad");
// Optional: You can call `AppLovin.PreloadInterstitial()` and listen to the "LOADED" event to preload the ad from the network before showing it
// Showing utilizing PreloadInterstitial and HasPreloadedInterstitial
if (AppLovin.HasPreloadedInterstitial())
{
// An ad is currently available, so show the interstitial.
#if UNITY_ANDROID
AppLovin.ShowInterstitialForZoneId("998d2ed211ae3efc"); // For Zone Non-RewardedFullScreen3
#endif
}
else
{
// No ad is available. Perform failover logic...
}
}
void onAppLovinEventReceived(string ev)
{
Debug.Log("called");
Log(ev);
if (ev.Contains("VIDEOBEGAN "))
{
Debug.Log("working");
// An ad was shown. Pause the game.
}
else if (ev.Contains("HIDDENINTER"))
{
// Ad ad was closed. Resume the game.
// If you're using PreloadInterstitial/HasPreloadedInterstitial, make a preload call here.
AppLovin.PreloadInterstitial();
}
else if (ev.Contains("LOADEDINTER"))
{
// An interstitial ad was successfully loaded.
}
else if (string.Equals(ev, "LOADINTERFAILED"))
{
// An interstitial ad failed to load.
}
}