Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Bug IUnityAdsListener.OnUnityAdsReady(...) behaves wierd

Discussion in 'Unity Ads & User Acquisition' started by Milgiray, Jan 28, 2022.

  1. Milgiray

    Milgiray

    Joined:
    Mar 11, 2017
    Posts:
    16
    IUnityAdsListener.OnUnityAdsReady behaves properly in Unity Editor, but in Android build it never gets called.

    I set button.interactable initial value using Advertisement.IsReady, and then listen to IUnityAdsListener.OnUnityAdsReady and make the button interactable as soon as it gets called. It works perfectly in Editor, but not in Android Build, it only starts to work after changing scene, yet it works only because Advertisement.IsReady is now true.

    Unity: 2021.2.7f1
    Advertisement Package: 3.7.5

    Remark #1: Both Unity Editor and Android Build are using the same gameID and placementID received from Unity Dashboard for Android Platform.

    Remark #2: Both Advertisement.AddListener and Advertisement.Initialize are called from Awake(), therefore it is not possible to use Advertisement API before it gets initialized.

    Remark #3: I tried both preplacing my AdsManager object, giving it some time to initialize before getting used, and creating it upon request (Singleton), but it didn't affect anything.

    I tried rewriting my AdsManager using official Unity Ads documentation as a reference, but I got a result where I could play ads in Editor, but not recieve reward as the method responsive for this was never called for some reason.