OneSignal-Flutter-SDK icon indicating copy to clipboard operation
OneSignal-Flutter-SDK copied to clipboard

[Bug]: Android notification permission prompt stalls in PermissionsActivity (Flutter 5.6.12)

Open shehanargaam opened this issue 2 months ago • 3 comments

What happened?

On Android, calling await OneSignal.Notifications.requestPermission(true) from a button tap leaves the app on OneSignal's com.onesignal.core.activities.PermissionsActivity. The Android notification permission dialog does not appear promptly and the app appears stuck. In our test it can take about five minutes before the system dialog opens. The Future also remains pending while this happens.

Observed on a Samsung SM-A556E running Android 16 (API 36), with the app targeting API 36. We saw the same behavior before upgrading from onesignal_flutter 5.6.10 to 5.6.12. Notification permission was denied at the time of the test. The SDK was initialized before the button was tapped.

The supplied logcat excerpt shows PermissionsActivity creating and drawing its window, with no permission dialog or exception in the captured interval. dumpsys activity still showed it as the top resumed activity afterward. This may be in the Flutter bridge or the Android SDK permission activity; I have not isolated which layer is responsible.

Steps to reproduce?

1. On a Samsung SM-A556E with Android 16, install an app targeting API 36 with notification permission not yet granted.
2. Initialize OneSignal with a valid app ID.
3. From a Flutter button handler, call `await OneSignal.Notifications.requestPermission(true);`.
4. Tap the button.
5. Observe that `com.onesignal.core.activities.PermissionsActivity` opens, but the Android permission dialog is delayed for minutes and the awaited call does not complete during the delay.

What did you expect to happen?

The Android notification permission dialog should appear promptly after the tap, and requestPermission should complete after the user grants or denies permission.

OneSignal Flutter SDK version

5.6.12 (also reproduced with 5.6.10)

Which platform(s) are affected?

  • [ ] iOS
  • [x] Android

Relevant log output

I/InsetsController: onStateChanged: host=<app>/com.onesignal.core.activities.PermissionsActivity
I/VRI[PermissionsActivity]: setView = com.android.internal.policy.DecorView@...
D/VRI[PermissionsActivity]: reportDrawFinished seqId=0

After the tap, `adb shell dumpsys activity activities` still reported:
topResumedActivity=com.onesignal.core.activities.PermissionsActivity

No Android permission dialog or OneSignal exception appeared in the captured log interval.

Code of Conduct

  • [x] I agree to follow this project's Code of Conduct

shehanargaam avatar Sep 23 '26 13:09 shehanargaam

@shehanargaam - we are looking into this and will get back to you with an update soon. Thanks

abdulraqeeb33 avatar Oct 05 '26 19:10 abdulraqeeb33

@shehanargaam the fix for this will be present in the next release. I will post an update when its ready. Thanks

abdulraqeeb33 avatar Oct 07 '26 18:10 abdulraqeeb33

Hi @abdulraqeeb33, Thank you very much. I'm waiting for the release.

shehanargaam avatar Oct 08 '26 04:10 shehanargaam