You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SDK returns wrong results for getPermissionAsync and requestPermission after user enables permissions via settings.
constsubscribe=async(): Promise<boolean>=>{if(awaitOneSignal.Notifications.getPermissionAsync()){if(!(awaitOneSignal.User.pushSubscription.getOptedInAsync())){OneSignal.User.pushSubscription.optIn();}// ... other subscription requirementsreturntrue;}else{constfallbackToSettings=true;if(awaitOneSignal.Notifications.canRequestPermission()){constenabled=awaitOneSignal.Notifications.requestPermission(fallbackToSettings);// ... other subscription requirementsreturnenabled;}else{// ... lead to fallback view}}}
Am I using the SDK wrong?
Steps to reproduce?
1. install react-native-onesignal v5.1.0
2. launch app on Android
3. disable notifications via phone settings for the app
4. launch app again
5. call requestPermission with fallback to settings
6. press Settings in the permission prompt
7. enable notifications in the phone settings
8. go back to the app
9. requestPermission returns false, further calls to getPermissionAsync also returns false
What did you expect to happen?
when user enabled notifications in settings requestPermission should have returned true as per contract. Furthermore, getPermissionAsync should return true too
React Native OneSignal SDK version
5.1.0
Which platform(s) are affected?
iOS (not tested)
Android
Relevant log output
No errors in logs
Code of Conduct
I agree to follow this project's Code of Conduct
The text was updated successfully, but these errors were encountered:
What happened?
SDK returns wrong results for getPermissionAsync and requestPermission after user enables permissions via settings.
Am I using the SDK wrong?
Steps to reproduce?
What did you expect to happen?
when user enabled notifications in settings requestPermission should have returned true as per contract. Furthermore, getPermissionAsync should return true too
React Native OneSignal SDK version
5.1.0
Which platform(s) are affected?
Relevant log output
No errors in logs
Code of Conduct
The text was updated successfully, but these errors were encountered: