Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

IUnityAdsListener is missing a callback for Load() failures

Discussion in 'Unity Ads & User Acquisition' started by vigoAtWork, Jan 9, 2020.

  1. vigoAtWork

    vigoAtWork

    Joined:
    Apr 25, 2016
    Posts:
    12
    When using the Load API lifecycle (i.e. use Advertisement.Initialize() with enablePerPlacementLoad = true), there's no simple way to find out whether Load() is still working (PlacementState.Waiting), or has silently given up (e.g. PlacementState.NoFill).
    Basically, you have to poll GetPlacementState(), but that is unreliable, too - it might return PlacementState.NotAvailable when called right after a Load(), even if an ad eventually loads (I'd expect it to always start with PlacementState.Waiting, if the existence of a placementId hasn't been verified yet).
    The OnUnityAdsDidError() callback seems to only work for Show() failures, as per documentation ("An IUnityAdsListener method that handles logic for ad content failing to display because of an error") and actual practice. As an aside - does anyone know whether OnUnityAdsDidError() and OnUnityAdsDidStart() (or OnUnityAdsDidError() and OnUnityAdsDidFinish()) might both be called on an actual error?
     
  2. vigoAtWork

    vigoAtWork

    Joined:
    Apr 25, 2016
    Posts:
    12
    TLDR: Advertisement.Load() should directly support asynchronous success and error handling.