Closed ducile closed 4 years ago
I'm not able to reproduce this issue with the example project app - tested on an iPhone 8 running iOS 14.1 and permission was requested successfully on each clean install.
Please build/run the example app and regression test using it to rule out the cause of the issue being specific to your codebase.
I can confirm that it works fine on the example project. However, I don't really have a clue why it doesn't work in my codebase.
I've just removed the promise wrapping as it could be a potential error case but without success. Do you have any idea where the problem might come from?
I'd suggest creating a new test project to track down the cause of the issue in your project: start with just this plugin to eliminate the possibility of conflict with another plugin. Start with the simplest test case to get it working then transition it to your implementation/project to find the cause.
However closing this as you've confirmed the test project works so it's not due to a plugin bug that affects all use cases.
Quick update: I've found the origin of the problem. There was a second call which requested the permission synchronously and therefore wasn't visible in the debugger. That second request caused the permission request function to break.
Bug report
CHECKLIST
[x] I have read the issue reporting guidelines
[x] I confirm this is a suspected bug or issue that will affect other users
[ ] I have reproduced the issue using the example project or provided the necessary information to reproduce the issue.
[x] I have read the documentation thoroughly and it does not help solve my issue.
[x] I have checked that no similar issues (open or closed) already exist.
Current behavior:
When reinstalling the application and requesting remote notification permissions for the first time, the requestRemoteNotificationAuthorization function will always trigger the error callback with
Remote notifications authorization was denied
even if you accepted the request.Expected behavior:
The function should go into the success callback and return the status depending on which option was chosen.
Steps to reproduce:
Screenshots
Environment information
Cordova CLI version
cordova -v 10.0.0
Cordova platform version
cordova platform ls 6.1.1
Plugins & versions installed in project (including this plugin)
Dev machine OS and version, e.g.
sw_vers 10.15.7
winver
Runtime issue
iOS build issue:
node -v 14.8.0
Related code:
Console output
console output
``` // Paste any relevant JS/native console output here ```**Other information:**