admin管理员组文章数量:1415467
I am trying to ask user to grant permissions by Notification.requestPermission()
, but it seems to work only in desktop browser.
In Android Chrome the prompt does not show up, but if I do alert(Notification.permission)
then it alerts denied.
What else can I do?
I am trying to ask user to grant permissions by Notification.requestPermission()
, but it seems to work only in desktop browser.
In Android Chrome the prompt does not show up, but if I do alert(Notification.permission)
then it alerts denied.
What else can I do?
Share Improve this question edited May 8, 2018 at 9:51 Jakub Kosior asked May 8, 2018 at 9:35 Jakub KosiorJakub Kosior 3161 gold badge3 silver badges12 bronze badges 2-
you might have blocked notifications in your mobile browser. so
denied
is ing. change that fromchrome content settings
– Sravan Commented May 8, 2018 at 9:54 - Ok, I found out what it was - it seems I have problem with serviceWorker registration – Jakub Kosior Commented May 8, 2018 at 10:00
2 Answers
Reset to default 4You might have blocked the notifications
in your mobile browser unknowingly
Activate
them again
Go to
Chrome => Settings => Advanced => Site Settings => Notifications and check Ask first
Allow or block notifications from some sites:
- On your Android phone or tablet, open the Chrome app Chrome.
- To the right of the address bar, tap More More and then Info Information.
- Tap Site Settings and then Notifications.
- If you don’t see the setting here, this website can’t send you notifications.
- Choose Allow or Ask first.
Here is the reference
Ps: It was an issue with his service worker registration. Anyway this answer can be helpful to any other user.
Ok, I found out what it was - it seems I have problem with serviceWorker registration, not with permissions.
Anyways, thank you Sravan
本文标签: javascriptPWArequesting permission not working on Android ChromeStack Overflow
版权声明:本文标题:javascript - PWA - requesting permission not working on Android Chrome - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745165099a2645634.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论