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
8
votes
1 answer

What are the difference between `pushManager.subscribe` and `pushManager.getSubscription` Service Worker's

PushManager.getSubscription() Retrieves an existing push subscription. It returns a Promise that resolves to a PushSubscription object containing details of an existing subscription. If no existing subscription exists, this resolves to a null…
7
votes
3 answers

Firefox Push API - AbortError: Error retrieving push subscription

I'm using Firefox Nightly of 46.0a1 version (there is only 42v. for OS X, and Push API requires 43v). And I'm getting this error: DOMException [AbortError: "Error retrieving push subscription" code: 20 nsresult: 0x80530014] Here is snippet where…
Mihail Zheludev
  • 166
  • 3
  • 10
7
votes
1 answer

How to de-duplicate notifications between native and progressive web app?

If I have both a native app and a progressive web app using web push notifications powered by service worker, is there a way to prevent a user from receiving duplicate notifications if they opt in to receiving notifications from the web site and…
owencm
  • 8,384
  • 6
  • 38
  • 54
6
votes
1 answer

getSubscription returns a null subscription

I am new to service workers and GAE, I am able to register the service workers but not able to subscribe the PushManager, getting subscription null error. Find the below code for reference. serviceWorkerRegistration.pushManager.getSubscription() …
Srinivas
  • 81
  • 2
  • 3
5
votes
1 answer

How to handle a subscribed user logging out?

In an application I am building, it is possible for a logged in user to receive specific push notifications related to activity their user account is participating in or subscribing to. As it stands at the moment, if a user logs out, they remain…
SpongeBobPHPants
  • 641
  • 7
  • 19
5
votes
1 answer

Can ServiceWorker be notified at selected time in offline?

Say, I want to make an alarm clock app on android as a progressive web app. Like a native alarm app, it should be notified at selected time even without active web page. At first, I considered using push api. But of course push message cannot be…
5
votes
3 answers

How to add analytics for Push notifications

I'm working on progressive web app, and I want to implement analytics for Push notifications. How can I add analytics for push notifications so that I'll be able to track and record how many people clicked on notification and how many people close…
5
votes
1 answer

Service Worker not prompting to be registered - net::ERR_FILE_EXISTS

I browsed through the other threads - there was no concrete answer. I implemented a service worker for notifcations http://docs.pushwoosh.com/docs/chrome-web-push I checked everything - all scripts are in root, the keys are well implemented.…
5
votes
1 answer

Chrome Push Notifications endpoint + user identification

I have plan to integrate Push Notifications for Chrome (Push API and Notification API). After successful subscription Chrome server send to client some special token ("endpoint") which you can use to identify the client and to send any push…
5
votes
1 answer

Is it possible to use the new Push Notifications support in Chrome without GCM?

Can I use a push service other than Google's GCM when using the new Push API with service workers?
owencm
  • 8,384
  • 6
  • 38
  • 54
5
votes
1 answer

Service Workers from an iframe for Chrome GCM notifications for web

I want to subscribe/ unsubscribe to a service worker to get Chrome GCM Notifications on web through an iframe. I have a working prototype which works fine while opening it directly on the browser and also from window.open javascript pop up. But it…
user3895143
  • 69
  • 1
  • 4
4
votes
1 answer

Is it really necessary to update the subscription on every page load?

I'm currently working on a web app which will allow a user to subscribe to push notifications. We'll store the subscriptions in a database table mapped against the user's ID and when a notification needs to be sent, we'll look up the user's…
SpongeBobPHPants
  • 641
  • 7
  • 19
4
votes
2 answers

pushpad error on Firefox 47: navigator.serviceWorker is undefined

Just started working with pushpad. Works great on first machine I tried it on. 1 other machine in office works, the other doesn't. All 3 are Firefox 47 on OSX. Console reads : navigator.serviceWorker is…
Joe Mandingo
  • 41
  • 1
  • 2
4
votes
1 answer

Service worker causing CORS issues on Firefox

I'm using service worker for push notifications, following this article. Everything is working with Chrome but with Firefox (v.44.0.2) I have a weird issue. On successful login to my app, I register the service worker which does nothing but waiting…
Dario
  • 6,152
  • 9
  • 39
  • 50
4
votes
2 answers

Getting customized message from GCM using Web push notifications

I'm using Web push notifications with Chrome, and they work great. But now I want to deliver a custom message in my notifications. I can have my Service Worker call out to my site to get content, as is done at…
Joe Marini
  • 1,540
  • 2
  • 11
  • 12