Search Unity

Resolved Ad Fail to load after LoadScene

Discussion in 'Unity Mediation' started by InsaneStudio, Jul 2, 2022.

  1. InsaneStudio

    InsaneStudio

    Joined:
    Jan 1, 2016
    Posts:
    4
    I spent countless hours trying to fix this issue with no luck.
    I'm using MediationExample sample from Mediation 0.5.0-preview.4
    everything works in the editor
    As soon as I run SceneManager.LoadScene(level) in IOS the ad stops loading and fails until app restart,
    errors I get in xcode :

    UMSWaterfallRun failed to load an ad with error (UMAAdapterLoadErrorAdapterAdNetworkError) and message (UnityAds placementId(Interstitial_iOS_92ce2ed0_e415_42f2_bfab_09cc79d07854) is already in use by another ad unit!)

    Interstitial Ad failed to load with error(UMSLoadErrorNoFill) : UMSLoadErrorNoFill : No line item could get fill!

    Demo Video :


    please help me out I'm desperate
     

    Attached Files:

  2. jcGrenier

    jcGrenier

    Unity Technologies

    Joined:
    Feb 23, 2021
    Posts:
    145
    Hi @InsaneStudio ,
    Without seeing your whole project it is a bit hard to pinpoint the issue, but I may have a guess given the context you gave us. What might be happening is that your ad is created in one scene, and not properly destroyed when moving scenes. this means that the ad is still loaded, and reserved, but you no longer have a handle on that ad object. When you try to load it again in the next scene, you get the message saying it is already loaded.

    To avoid that I would recommend using a static class/singleton to manage your ads through your application, it could be a GameObject flagged with DontDestroyOnLoad, or just a class that is not a monobehavior at all.

    Hope that helps
     
    DeclanMcPartlin and InsaneStudio like this.
  3. InsaneStudio

    InsaneStudio

    Joined:
    Jan 1, 2016
    Posts:
    4
    Hey thank you for your help, DontDestroyOnLoad fixed my issue, It is weird that there is no mention of how to properly destroy an ad, not even the example mediation sample, I hope this helps people with the same issue, thank you again for you time
     
    jcGrenier likes this.