-
Notifications
You must be signed in to change notification settings - Fork 374
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]: Notifications.hasPermission() does not always return a boolean on iOS #1555
Comments
Hello @Bjarkinn thank you for flagging! We'll work on a fix for this and let you know when it's released! |
On a related note there is a bug reported here also related to Perhaps these can be investigated together. fyi this one also affects android not just ios |
@Bjarkinn @jennantilla I can also confirm this is also happening on Android, not just iOS. And not just the const handler = (granted: boolean) => {
console.log('PERM CHANGE HANDLER', granted); // PERM CHANGE HANDLER {"permission": true}
};
OneSignal.Notifications.addEventListener('permissionChange', handler); This is fine as I can extract the permission, maybe it is just the types need updating: |
We did this for now:
|
Hello everyone! Thank you for your patience. A fix for this is available in our latest release, 5.0.1. Please let us know if you have any additional questions or concerns! |
Looks like everything behaves like it should on 5.0.1 |
Same issue on V5.0.4 @jennantilla |
This issue should be reopened because there is a new issue occurred in which the Boolean itself started returning false always. |
No this issue should not be reopened as you say:
It is a new issue, so please open a new issue instead of commenting on old ones. |
What happened?
If the notification permission is checked after the permission is manually changed by the user in the settings the
Notifications.hasPermission()
function returns the following object{permission: boolean}
instead of booleanVideo
OneSignal_iOS_bug.MOV
In the video The following code was used that calls
Notifications.hasPermission()
every time the app comes into foregroundSteps to reproduce?
What did you expect to happen?
I expected
Notifications.hasPermission()
to always return a booleanReact Native OneSignal SDK version
5.0.0
Which platform(s) are affected?
Relevant log output
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: