Back to all

Opening OneSignal push notifications from Android when app is closed leads to infinite loop where nothing is loaded

Steps to reproduce:

  1. Setup an Android app with OneSignal Push Notifications
  2. Launch the Android App, make sure you are subscribed to Push Notifications
  3. Kill the app
  4. Send a push notification via OneSignal's API, receive it on the device
  5. Tap on the notification to open the app
  6. Observe that no views are ever loaded, the app opens to a blank window.

The following stacktrace is printed as a warning infinitely until the app is killed:


Application attempted to call on a destroyed WebView
                                                                                                    java.lang.Throwable
                                                                                                    	at org.chromium.android_webview.AwContents.q(chromium-SystemWebViewGoogle6432.aab-stable-768011903:10)
                                                                                                    	at com.android.webview.chromium.WebViewChromium.f(chromium-SystemWebViewGoogle6432.aab-stable-768011903:22)
                                                                                                    	at com.android.webview.chromium.WebViewChromium.loadUrl(chromium-SystemWebViewGoogle6432.aab-stable-768011903:47)
                                                                                                    	at android.webkit.WebView.loadUrl(WebView.java:749)
                                                                                                    	at co.median.android.LeanWebView.loadUrlDirect(LeanWebView.java:374)
                                                                                                    	at co.median.android.UrlNavigation$6.run(UrlNavigation.java:481)
                                                                                                    	at android.os.Handler.handleCallback(Handler.java:1095)
                                                                                                    	at android.os.Handler.dispatchMessageImpl(Handler.java:135)
                                                                                                    	at android.os.Handler.dispatchMessage(Handler.java:125)
                                                                                                    	at android.os.Looper.loopOnce(Looper.java:269)
                                                                                                    	at android.os.Looper.loop(Looper.java:367)
                                                                                                    	at android.app.ActivityThread.main(ActivityThread.java:9333)
                                                                                                    	at java.lang.reflect.Method.invoke(Native Method)
                                                                                                    	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:566)
                                                                                                    	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:929)