最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - PWA - requesting permission not working on Android Chrome - Stack Overflow

programmeradmin1浏览0评论

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 from chrome 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
Add a ment  | 

2 Answers 2

Reset to default 4

You 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:

  1. On your Android phone or tablet, open the Chrome app Chrome.
  2. To the right of the address bar, tap More More and then Info Information.
  3. Tap Site Settings and then Notifications.
  4. If you don’t see the setting here, this website can’t send you notifications.
  5. 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

发布评论

评论列表(0)

  1. 暂无评论