-
Notifications
You must be signed in to change notification settings - Fork 198
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]: Android: Notifications.requestPermission hangs (capacitor) and hasPermissions() always returns false #932
Comments
I have worked around this issue by wrapping this requestPermission prompt in a call to
|
Another workaround is to not
|
Hi @kpturner, we have implemented a fix for
Can you tell me more about this? Is it always |
I do not think I am in a position to test "all devices and use cases". Perhaps you can tell me a device (simulator and API version) where it correctly returns |
Hi @kpturner, just in your own testing if this was the case 100% of the time? I most recently tried to reproduce in an Android emulator Nexus S API 33 using a minimal app:
|
Here are the dependencies in use:
|
I am wondering if this was purely down to the timing of the call to |
What happened?
Using version 5.0.2 - when an app is installed for the first time on Android and runs
Notifications.requestPermission(true)
The user is prompted to allow notifications.
In previous versions of the SDK, you could call
Notifications.requestPermissions
with impunity. If you do so when the user has already agreed, then the request is ignored. Now, if you do so, the request just hangs causing the app to become unresponsive. You cannot even condition the call toNotifications.requestPermissions
becauseNotifications.hasPermission()
always returnsfalse
.Steps to reproduce?
What did you expect to happen?
Notifications.requestPermission(true) should behave as it did before. Prompt the user only if necessary and do not hang.
hasPermissions() should return the correct value
OneSignal Cordova SDK version
5.0.2
Which platform(s) are affected?
Relevant log output
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: