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

fix(local-notifications): requestPermissions and checkPermissions return if enabled #494

Merged
merged 2 commits into from
Jun 24, 2021

Conversation

jcesarmobile
Copy link
Member

We have an areEnabled() method that tells users if notifications are enabled or not, but the method is deprecated, it says:

@deprecated Use checkPermissions() to check if the user has allowed notifications to be displayed.

But on Android, checkPermissions() always returns "granted" because there is no real notification permission, so takes that as granted. So it can't be a real replacement for areEnabled() as it returns if the notifications are enabled or not.

This PR adds native checkPermissions() and requestPermissions() methods that will replace the ones in Plugin class and return if the notifications are enabled or not.

@Ionitron Ionitron added this to Needs review 🤔 in Capacitor Engineering ⚡️ Jun 23, 2021
@jcesarmobile jcesarmobile merged commit 555bb1f into main Jun 24, 2021
@jcesarmobile jcesarmobile deleted the local-perm branch June 24, 2021 14:59
Capacitor Engineering ⚡️ automation moved this from Needs review 🤔 to Done 🎉 Jun 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

None yet

2 participants