Questions tagged [push-api]

The Web Push API lets users of your Web app receive push notifications at any time—even in the background; that is, even when your Web app is not currently running in the foreground on the user’s device (or even when the browser on the user’s device is not currently running). It use Service Workers to handle messages sent using common push services, and to allow your Web app to react to the push notifications it receives.

For more information about the Web Push API, see the actual Push API spec and the articles Using the Push API and Push Notifications on the Open Web. The MDN article Using Service Workers is also relevant.

The IETF standards that describe the Web Push protocol and its message encryption scheme are really useful to understand how to build an application server that sends push notifications to clients and how to encrypt push message payloads.

117 questions
4
votes
3 answers

Service worker events related to web push notifications

In web push notifications documentation, I see that service worker can get triggered by few events like push, notificationclick. For tracking CTR, notificationclick event is very important. Similarly, is there any event like 'rejectnotification'…
4
votes
1 answer

How to register a service worker from a different domain

I am trying to implement Push Notifications for Google Chrome. I want to register service worker from a different domain. Example: Service Worker Code is located at: https://example.com/ I want to register the service worker (which is located at…
A NooB
  • 73
  • 1
  • 8
4
votes
1 answer

How do I install both a service worker and a manifest with a single Javascript tag?

I've built a service for websites to easily integrate push notifications into their site but the current Chrome implementation also requires they set up a manifest and service worker. Is there any way to set up the service worker and manifest with…
owencm
  • 8,384
  • 6
  • 38
  • 54
3
votes
0 answers

How do I send a push notification using Push API with Vapid keys in Postman?

How do I send a push notification in postman, if I have the vapid keys and the subscriber? I have already configured the service worker, so thats not the question. I just want to send a simple request to test if it works. For demonstrating purposes,…
oemera
  • 3,223
  • 1
  • 19
  • 33
3
votes
1 answer

Can I use web push notifications to update the page without displaying a notification?

I am wondering if I can use web push notifications to update a web page without displaying a notification for the user to interact with. Essentially I want to refresh data after an event on the server. If this is possible, is it still necessary to…
CJ Jessett
  • 39
  • 4
3
votes
1 answer

push subscription error not triggering catch

I am trying to take a specific action if my push registration fails. To make the subscription fail, I have removed the to the manifest.json file (I'm using Chrome). I get the following error as expected: Uncaught (in promise) DOMException:…
David
  • 2,846
  • 3
  • 22
  • 34
3
votes
1 answer

Questions about keeping Service Worker Push Subscriptions In Sync

I've read the push subscription can get out of sync between the browser and the push service. I've seen two remediations, both look to be non-standard: ServiceWorkerGlobalScope.onpushsubscriptionchange GCM send response, mentioned here, spelled out…
Alex Grant
  • 363
  • 3
  • 10
3
votes
3 answers

How to schedule a chrome push notification?

I am implementing chrome push notification for my website users. Which I am able to do successfully via service worker. I am following these…
3
votes
1 answer

How can I read pushSubscription.endpoint inside service worker?

I'm using Google Chrome Service Worker to implement a push notification service for my web-users. Given Chrome current security constraints is not possible to send a payload so I'm fetching the content from my webserver, however is quite complicated…
3
votes
1 answer

Not able to load data URL for GCM push notification for chrome in 'notificationclick' event

While working on GCM push notification for Chrome, I have set up push notifications for when a service worker receives a push event for GCM. I am launching a service call. That service returns a data object in which I have a URL which I want to open…
Yogendra
  • 2,139
  • 3
  • 14
  • 27
2
votes
0 answers

Does FCM support push notification to PWA on iPhone?

I host a PWA website and I am trying to integrate push notifications to my users who may have the website open in a browser tab even if their phones are inactive. You notoriously can't send Push notifications to iPhones without using Apple Push…
Phil
  • 1,996
  • 1
  • 19
  • 26
2
votes
1 answer

getRegistration().then gives just undefined

I am virtually a baby with Promise and serviceWorker things, and I have no idea why this happens. I had watched a video about Web Push and Notifications. https://youtu.be/ggUY0Q4f5ok At 1:26 of the video, it presents this code and says "You can also…
dbld
  • 998
  • 1
  • 7
  • 17
2
votes
1 answer

Custom Push Service

In the context of pushing notifications to web-browsers, the PUSH SERVICE acts as interface between the SERVICE WORKER and APPLICATION SERVER. My current understanding is that Google FCM is the Push Service for Google Chrome & FireFox…
2
votes
1 answer

Web Push API - Send notifications to multiple recipients

Using the W3C Web Push API is it possible to send a push notification in batch so it is received by multiple users ? When subscribing a user agent for notification we obtain a unique endpoint such…
willogeard
  • 21
  • 2
2
votes
1 answer

Issue with .subscribe() method of pushManager

I am following this very clear tutorial. All works except that when I get to the stage subscribing a user with pushManager when I call pushManager.subscribe() I don't get any response from the promise whose status is pending. Maybe I am missing some…
Andy
  • 1,307
  • 1
  • 12
  • 17