Search Unity

Banner ads stuck in "Waiting" state

Discussion in 'Unity Ads & User Acquisition' started by mm1982, Mar 9, 2019.

  1. mm1982

    mm1982

    Joined:
    Apr 28, 2015
    Posts:
    35
    Hi,

    Im implementing Unity's banner ads. There are issues getting production ads to show (test ads show fine).

    This is the basic code
    Code (CSharp):
    1. Advertisement.Initialize(gameId, false);
    2.  
    3. while(!Advertisement.IsReady(placementId)) {
    4.     yield return Timing.WaitForSeconds(0.5f);
    5. }
    6.  
    7. var opts = new BannerOptions();
    8. opts.showCallback = OnBannerFinished;
    9. Advertisement.Banner.Show(placementId, opts);
    10. while(true) {
    11.     yield return Timing.WaitForSeconds(0.5f);
    12.     Debug.Log("banner state = " + Advertisement.GetPlacementState(placementId));
    13. }
    14.  
    the OnBannerFinished callback never fires, and GetPlacementState() always returns "Waiting" forever.

    Alternatively, trying to call
    Code (CSharp):
    1.  
    2. BannerLoadOptions loadOpts = new BannerLoadOptions {
    3.     errorCallback = OnBannerFailed
    4. };
    5. Advertisement.Banner.Load(placementId, loadOpts);
    6.  
    The errorCallback is fired immediately with error "Unity Ads is not initialized", despite calling Initialize() first and also waiting for Advertisement.isInitialized to be true.

    Has anyone else experienced the same issue? Im located in Canada. Unity 2017.4 and latest Monetization SDK from the asset store 3.0.1. Tested on Android
     
    Last edited: Mar 9, 2019
  2. mm1982

    mm1982

    Joined:
    Apr 28, 2015
    Posts:
    35
    I dont know if this is related, but I always get this error at startup as well

    Code (csharp):
    1.  
    2. Failure has occurred while loading a type.
    3. UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
    4. UnityEngine.Logger:Log(LogType, Object)
    5. UnityEngine.Monetization.Analytics:InitializeStandardEvents()
    6. UnityEngine.Monetization.Analytics:SetAnalyticsEventExtra(String, Object)
    7. UnityEngine.Monetization.Analytics:SetAnalyticsEventExtra(String)
    8. System.Reflection.MonoMethod:Invoke(Object, BindingFlags, Binder, Object[], CultureInfo)
    9. System.Reflection.MethodBase:Invoke(Object, Object[])
    10. UnityEngine.AndroidJavaProxy:Invoke(String, Object[])
    11. UnityEngine._AndroidJNIHelper:InvokeJavaProxyMethod(AndroidJavaProxy, IntPtr, IntPtr)
    12.  
     
  3. mm1982

    mm1982

    Joined:
    Apr 28, 2015
    Posts:
    35
    Update: now the state is returning PlacementState.Ready, but yet, my show callback never fires and the banner never appears. Does this indicate there is no fill? Or is this an error? How can I distinguish between them?