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: `checkPermission()" is wrongly delivering "prompt" when denied before. #88

Closed
gklasen opened this issue Apr 28, 2024 · 1 comment
Closed

Comments

@gklasen
Copy link

gklasen commented Apr 28, 2024

Hey, whenever i triggered requestPermission() in the Plugin and i decline it, console.log(await SpeechRecognition.checkPermissions()) will deliver speechRecognition: "prompt". Instead, it should be "denied", no?

Operating on Android 13.

@jcesarmobile
Copy link
Contributor

requestPermission() is deprecated, the correct method is requestPermissions().

On Android, when the permission is denied once, it still allows to request the permission again, in that case checkPermissions() returns prompt-with-rationale, meaning you should show the user some custom message explaining why the permission is important for your app to work before calling requestPermissions() again as it the user doesn't allow the permission the second time you won't be able to request it again.

I'm removing requestPermission() and hasPermission() in next major release to avoid the confusion.

@jcesarmobile jcesarmobile closed this as not planned Won't fix, can't repro, duplicate, stale Jun 7, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants