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
1 Answer
Reset to default 5See:
- 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()
.