react-native-onesignal icon indicating copy to clipboard operation
react-native-onesignal copied to clipboard

[Bug]: Permission Not Granted (Android)

Open johannessachse opened this issue 10 months ago • 11 comments

What happened?

Since version 5.0.6 some Android devices (f.e. Pixel 7, Android 14) in our OneSignal dashboard have "Subscription Status: Permission Not Granted". On my SM-T510 (Android 11) everything works fine. On iOS everything works fine too.

When logging OneSignal.Notifications.hasPermission() or OneSignal.Notifications.getPermissionAsync() we always get true as excepted.

Versions: react-native: 0.72.7 react-native-onesignal: 5.0.5 (works) react-native-onesignal: 5.0.6 (does not work) react-native-onesignal: 5.1.0 (does not work)

Steps to reproduce?

1. Launch app
2. Grant notification permission
3. Check for subscription status in dashboard

What did you expect to happen?

I expect that we get "Subscription Status: Permission Granted"

React Native OneSignal SDK version

Release 5.1.0

Which platform(s) are affected?

  • [ ] iOS
  • [X] Android

Relevant log output

        // Logs of the device with granted permissions
        const canRequestPermission = await OneSignal.Notifications.canRequestPermission();
        console.log('canRequestPermission', canRequestPermission); // false

        const hasPermission = OneSignal.Notifications.hasPermission();
        console.log('hasPermission', hasPermission); // true

        const getPermissionAsync = await OneSignal.Notifications.getPermissionAsync();
        console.log('getPermissionAsync', getPermissionAsync); // true

        const requestPermission = await OneSignal.Notifications.requestPermission(true);
        console.log('requestPermission', requestPermission); // true

Code of Conduct

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

johannessachse avatar Apr 04 '24 14:04 johannessachse

onesignal sdk version 5.1.1 and 5.1.2 have same problem. any solutions?

hjun555 avatar Apr 23 '24 05:04 hjun555

We are currently in contact with OneSignal support and waiting for the issue to be resolved.

johannessachse avatar Apr 23 '24 06:04 johannessachse

@johannessachse
Do you use externalId? I removed all devices which have same external id and it become works. Hope this helps you.

hjun555 avatar Apr 23 '24 06:04 hjun555

@johannessachse Do you use externalId? I removed all devices which have same external id and it become works. Hope this helps you.

What do you mean with externId? We only have the Subscription ID and OneSignal ID. Did you remove the devices via the "Subscription Records" Dashboard?

johannessachse avatar Apr 24 '24 05:04 johannessachse

maybe related to android version, from 13 and above there is this issue going around :: https://github.com/OneSignal/OneSignal-Android-SDK/issues/1824#issuecomment-1914733585 add implementation "com.google.firebase:firebase-messaging:23.4.0" in app/build.gradle

BishalftSaikia avatar May 08 '24 07:05 BishalftSaikia

Hello, same here, any update ?

humqn avatar May 29 '24 20:05 humqn

@humqn I don't think so. We still use version 5.0.5 (works). Maybe there is a fix in the latest version. But we haven't tested it yet.

johannessachse avatar May 30 '24 12:05 johannessachse

@johannessachse ok thank you, I have downgraded to 5.0.5 and it works as desired.

humqn avatar May 30 '24 14:05 humqn

any further updates?? Im using react-native-onesignal v5.2.0 and am also having this issue with Android devices

konangels avatar Jul 31 '24 06:07 konangels

@konangels We are still waiting for a fix.

johannessachse avatar Aug 01 '24 11:08 johannessachse

@johannessachse appreciate the update. Thank you.

konangels avatar Aug 01 '24 22:08 konangels