Search Unity

Unity Ads stops loading on some android devices after app has been sleeping

Discussion in 'Unity Ads & User Acquisition' started by andrasgabor, May 20, 2020.

  1. andrasgabor

    andrasgabor

    Joined:
    Jun 4, 2018
    Posts:
    1
    I submitted a ticket about this to Unity, but I wonder if anyone else has experienced the same and found some workaround to this.

    Using Unity Ads on Android. On some devices, when we leave the phone alone with the app running ads stop loading when we reopen the app (after few hours). While on some other devices or when not so much time passes the error does not occur.
    Using a dev build and test ads I find this in logcats:
    Normal case: I can see a "RESUMED" event being handled by the WebViewApp.
    Error: case: This line is missing and nothing else is in the logs from UnityAds after on.
    Once the app is closed and restarted, ads work again.

    RESUMED debug line:
    D UnityAds: com.unity3d.services.core.webview.WebViewApp.invokeJavascriptMethod() (line:104) :: Invoking javascript: javascript:window.nativebridge.handleEvent(["LIFECYCLE","RESUMED","com.unity3d.player.UnityPlayerActivity"]);
     
  2. krzysztofpruski94

    krzysztofpruski94

    Joined:
    Oct 11, 2019
    Posts:
    1
    We encountered the same problem in our app. After locking/unlocking screen ( even before the ads are initialized) ads crash, lock screen and show only black screen. Is there any solution to this problem ?
     
  3. henryfjones

    henryfjones

    Joined:
    Feb 29, 2020
    Posts:
    4
    Did you get a solution to this? I also am encountering this. I reinitialise the ads when the game is navigated back to and wait for the Ad to be ready. But it seems to fail to show an Ad once a user has been off the game for a while. However, when the user closes the game and then relaunches it, Ads work fine.