web-push

Remove a Web Push Notification

跟風遠走 提交于 2021-02-07 17:53:10
问题 Is there a way to remove a Web Push Notification once shown? To remove it from the notification list on the device - or mark it as "read"? I assume this can't be done from the server, and I've been hunting around for a Javascript API - but I haven't found anything. (The wider problem that I'm trying to crack is how to synchronise notifications on multiple screens/browsers/devices.) 回答1: I think might be impossible. As you can show and hide a notification. And this can be a workaround for

How should I handle the pushsubscriptionchange event?

房东的猫 提交于 2021-01-27 12:07:50
问题 According to the spec, a pushsubscriptionchange event indicates that "a push subscription has been invalidated, or will soon be invalidated." What are the best practices for handling this event? 回答1: Process the re-subscription entirely within the service worker. There may be no client (i.e. open pages) associated with the service worker at the point the event is fired--do not use postMessage() to trigger a re-subscription from the client. Implementations are likely to honour the old

How to use process.env in a React service worker

为君一笑 提交于 2021-01-26 05:37:22
问题 I am trying to set-up a Firebase-messaging-sw.js file (for web push notifications). I am wondering if there is a way to avoid exposing my Firebase config data to the public as much as possible - though it might be revealed anyways? (I'm not too sure about the nuances) I've tried following: How can I customize my Service Worker based on environment variables? But the answer's swEnvbuild doesn't seem to be running, as the swenv.js file is not found. I suspect it might need to be set-up

How to use process.env in a React service worker

杀马特。学长 韩版系。学妹 提交于 2021-01-26 05:36:28
问题 I am trying to set-up a Firebase-messaging-sw.js file (for web push notifications). I am wondering if there is a way to avoid exposing my Firebase config data to the public as much as possible - though it might be revealed anyways? (I'm not too sure about the nuances) I've tried following: How can I customize my Service Worker based on environment variables? But the answer's swEnvbuild doesn't seem to be running, as the swenv.js file is not found. I suspect it might need to be set-up

How web push protocol works?

那年仲夏 提交于 2020-11-29 03:56:09
问题 Problem I am wondering how webpush protocol works? Does it keep some kind of connection open like WebSocket protocol? Or does it use mechanism similar to polling ? Tried According to documentation WebPush uses HTTP 2.0 server push: A simple protocol for the delivery of real-time events to user agents is described. This scheme uses HTTP/2 server push. Server push wikipedia: HTTP/2 Server Push is not a notification mechanism from server to client. Instead, pushed resources are used by the

Display Web Push Notification with long title/body/text on Chrome/Firefox without having it truncated

笑着哭i 提交于 2020-04-30 10:12:47
问题 I completed Google's tutorial for web push notifications (https://developers.google.com/web/fundamentals/getting-started/codelabs/push-notifications/) and added a service worker to my web app. However, I noticed the notification text is truncated on most cases, like in the following example: truncated text notification example I would like to display a web push notification on Chrome/Firefox with a relatively long body (2-3 lines) and possibly a long title (2-3 lines). Is there official

Firebase Cloud Messaging not working with Samsung Internet

爱⌒轻易说出口 提交于 2020-04-17 06:03:39
问题 I'm setting up Firebase Cloud Messaging to do push notifications on the web. It works but only with Chrome (Windows and Android) and Firefox(Android) so far. It's not working on Samsung Internet Browser (the browser that comes pre-installed on Samsung's phones) and I haven't gotten a chance to test on iOS so far. I've tried adding the sender id as gcm_sender_id to the Cloud Function I'm using as well as to the manifest.json file to no avail. Below is how the notification body is set up. //

Does my web application require SSL for Firebase Cloud Messaging for Web to work? [closed]

独自空忆成欢 提交于 2020-02-25 04:16:31
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 2 years ago . With Firebase Cloud Messaging for Web, 1. Does my web application domain still require SSL? 2. Or only the service worker.js needs to be on an SSL site? if so, can I host the service worker on an SSL site but keep my web application on a non-SSL site? Any feedback is much

Does my web application require SSL for Firebase Cloud Messaging for Web to work? [closed]

两盒软妹~` 提交于 2020-02-25 04:15:43
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 2 years ago . With Firebase Cloud Messaging for Web, 1. Does my web application domain still require SSL? 2. Or only the service worker.js needs to be on an SSL site? if so, can I host the service worker on an SSL site but keep my web application on a non-SSL site? Any feedback is much

Web Push Notification: How to use Web Push PHP Library?

。_饼干妹妹 提交于 2020-01-22 05:50:21
问题 I Want to add Web Notification to my website. I searched on Google and found some tutorials about it. As described in these tutorials I manage to show subscription box to the visitors and I can store their data also. Main.js 'use strict'; const applicationServerPublicKey = 'BBw_opB12mBhg66Dc94m7pOlTTHb5oqFAafbhN-BNeazWk8woAcSeHdgbmQaroCYssUkqFfoHqEJyCKw'; const pushButton = document.querySelector('.js-push-btn'); let isSubscribed = false; let swRegistration = null; function urlB64ToUint8Array