Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Permission Not Granted (Android) #1679

Open
2 of 3 tasks
johannessachse opened this issue Apr 4, 2024 · 5 comments
Open
2 of 3 tasks

[Bug]: Permission Not Granted (Android) #1679

johannessachse opened this issue Apr 4, 2024 · 5 comments

Comments

@johannessachse
Copy link

johannessachse commented Apr 4, 2024

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
  • 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

  • I agree to follow this project's Code of Conduct
@hjun555
Copy link

hjun555 commented Apr 23, 2024

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

@johannessachse
Copy link
Author

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

@hjun555
Copy link

hjun555 commented Apr 23, 2024

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

@johannessachse
Copy link
Author

johannessachse commented Apr 24, 2024

@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?

@BishalftSaikia
Copy link

BishalftSaikia commented May 8, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants