Back to all

Android ANR caused by OneSignal v5 getUser() blocking main thread during cold start

Hello Median team,

My published Android app, Bondimi, is experiencing a high user-perceived ANR rate of approximately 3.82% in Google Play Console.

The main affected ANR is:

co.median.android.plugins.oneSignal_v5.OneSignalManager.getUserInfo

The ANR reason is Input dispatching timed out.

The main-thread stack trace includes:

com.onesignal.internal.OneSignalImp.waitForInit
com.onesignal.internal.OneSignalImp.getUser
com.onesignal.OneSignal.getUser
co.median.android.plugins.oneSignal_v5.OneSignalManager.getUserInfo
co.median.android.plugins.oneSignal_v5.OneSignalPlugin.onPageFinish
co.median.android.GoNativeWebViewClient.onPageFinished

The stack trace suggests that Median's OneSignal v5 plugin calls OneSignal.getUser() synchronously on the Android main thread while the WebView finishes loading. The OneSignal SDK then waits for initialization, potentially causing the UI to become unresponsive.

My current configuration uses OneSignal v5+, with Legacy Mode disabled and automatic registration enabled. Push notifications are working successfully on physical devices.

Could the Median team please clarify:

Is this a known issue with the OneSignal v5 plugin?

Which OneSignal Android SDK version is included in the current Median build?

Is there a plugin or build update that prevents this blocking call on the main thread?

Does the fix require a change to Median's native plugin?

Can this be resolved without disabling or reducing push notifications?

I want to preserve all existing notification delivery, account linking, notification taps and in-app notification functionality.

I would appreciate advice on the safest fix and how to test it before publishing an updated build.

Thank you.