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]: Notification permission status evaluates to incorrect value after setting and immediately closing app #138

Open
iAmWillShepherd opened this issue Mar 4, 2024 · 0 comments

Comments

@iAmWillShepherd
Copy link

iAmWillShepherd commented Mar 4, 2024

What happened?

When using react-onesignal@3.0.1 in a Safari Mobile PWA, the permission status does not correctly reflect "denied" after a user initially denies notification permissions.

What browsers are you seeing the problem on?

Safari

What operating system are you running?

iOS 16+

Steps to reproduce?

1. Initially, `OneSignal.Notifications.permissionNative` correctly evaluates to  "default".
2. The user denies the notification permission when prompted and closes the app.
3. Upon reopening the app, the permission status is still evaluated to "default" instead of "denied."
4. The permission is correctly evaluated as "denied" only after re-requesting permission.
5. The app must know the actual permission value on the initial load after the user has denied permission.
6. Attempted to get the correct status using `OneSignalDeferred` and `OneSignal.Notifications.permissionNative`.

What did you expect to happen?

For OneSignal.Notifications.permissionNative to evaluate to "denied" right after the app is reopened following an initial permission denial.

Relevant log output

No response

@iAmWillShepherd iAmWillShepherd changed the title [Bug]: [Bug]: Notification permission status evaluates to incorrect value after setting and immediately closing app Mar 4, 2024
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

1 participant