javascript - How to reRequest permission for showing notifications in Firebase Cloud Messaging? - Stack Overflow

I'm developing the push notifications for web app with Firebase Cloud Messaging.After the first ru

I'm developing the push notifications for web app with Firebase Cloud Messaging.

After the first run I got request notification promt because of this code:

const messaging = firebase.messaging();
    messaging
        .requestPermission()
        ..........

I have granted the permission, but now when I visit this page I didn't ever see the request for permission promt because I already granted the permission while the first run. How can I unsubscribe my device to see permission requests again?

I'm developing the push notifications for web app with Firebase Cloud Messaging.

After the first run I got request notification promt because of this code:

const messaging = firebase.messaging();
    messaging
        .requestPermission()
        ..........

I have granted the permission, but now when I visit this page I didn't ever see the request for permission promt because I already granted the permission while the first run. How can I unsubscribe my device to see permission requests again?

Share Improve this question edited Aug 19, 2019 at 14:15 Frank van Puffelen 601k85 gold badges890 silver badges860 bronze badges asked Aug 19, 2019 at 13:57 DmitryDmitry 834 silver badges11 bronze badges 2
  • 1 In desktop/Android Chrome, at least, you can click the lock next to the URL, go to "Site Settings", and then change the "Notifications" setting. – Michael Bleigh Commented Aug 19, 2019 at 16:02
  • @MichaelBleigh, yes I read about this. I thought it is possible to do it programmatically. Thank you. – Dmitry Commented Aug 20, 2019 at 7:58
Add a ment  | 

1 Answer 1

Reset to default 5

See:

  • https://support.google./chrome/answer/3220216?co=GENIE.Platform%3DDesktop&oco=0&hl=en
  • chrome://settings/content/notifications
  • https://firebase.google./support/release-notes/js#cloud-messaging
  • https://developer.mozilla/ja/docs/Web/API/notification/requestPermission

Deprecated requestPermission(). Use the native browser API Notification.requestPermission() instead.

If firebase version is newer 6.0.4 then you should use Notification.requestPermission().

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744656867a4586236.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信