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”]);