react-native-onesignal
react-native-onesignal copied to clipboard
[Bug]: Permission Not Granted (Android)
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
onesignal sdk version 5.1.1 and 5.1.2 have same problem. any solutions?
We are currently in contact with OneSignal support and waiting for the issue to be resolved.
@johannessachse
Do you use externalId? I removed all devices which have same external id and it become works.
Hope this helps you.
@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?
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
Hello, same here, any update ?
@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 ok thank you, I have downgraded to 5.0.5 and it works as desired.
any further updates?? Im using react-native-onesignal v5.2.0 and am also having this issue with Android devices
@konangels We are still waiting for a fix.
@johannessachse appreciate the update. Thank you.