我的Applovin回调在Unity 3d中是否正常工作?

时间:2019-01-18 15:32:04

标签: c# unity3d listener integration applovin

我不确定是否正确设置了事件回调,这些事件将触发到哪里?我已经设置了测试广告,并且所有不同类型的广告都可以正常运行。

我有一个游戏对象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.
    }
}

0 个答案:

没有答案