Fix requestPermission to reject the promise when permission is denied#1632
Fix requestPermission to reject the promise when permission is denied#1632Basil-Code wants to merge 2 commits intoOneSignal:rel/5.0.4from
Conversation
|
Hi @Basil-Code, Thanks for submitting this PR.
I think this description in the PR changed after your second commit? It looks like these changes are primarily making null checks on Did you encounter these as issues? |
Hi @nan-li, |
|
Hi @Basil-Code, sorry for the delay. The null checks you added are good for safety and don't have any side effects, so they look good to me. Can you tell me more about the NPE crashes you experienced?
Feel free to open an issue with your crashes. |
Sure, I'll open an issue if the crash still happens. |
|
Hey there, thanks for submitting this PR. Given how long this has been open, I'm going to close it as part of cleaning up our backlog. |
Description
One Line Summary
Fix the requestPermission method when the permission is denied, and resolve ONLY if the permission is granted. Also fixing NullPointerException when attempting to access the data and/or result.getThrowable().getMessage().
Details
Motivation
I faced this issue while implementing the notification permissions, when I deny the permission request the promise is never rejected.
Testing
Manual testing
Tested on Samsung A33
Affected code checklist
Checklist
Overview
Testing
Final pass
This change is