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
228
votes
10 answers

How to send push notification to web browser?

I have been reading for past few hours about Push Notification API and Web Notification API. I also discovered that Google & Apple gives push notification service for free via GCM and APNS respectively. I am trying to understand if we can implement…
esafwan
  • 17,311
  • 33
  • 107
  • 166
44
votes
7 answers

Chrome Push Notification: This site has been updated in the background

While implementing the chrome push notification, we were fetching the latest change from our server. While doing so, the service-worker is showing an extra notification with the message This site has been updated in the background Already tried…
42
votes
2 answers

Asp Net Core Web Push Notifications

Main goal is to add to site ability to send web notification to pop up a system notification to alert the user using Html5 Push API and service workers. Not using SignalR which only can run client scripts while site is opened. Also should be ability…
aleha_84
  • 8,309
  • 2
  • 38
  • 46
39
votes
2 answers

What is the difference between Push API and Server Sent Events?

From the documentation I could figure out that Push API and Server Sent Events both are half duplex but why two different technologies for the same functionality? Is there something more significant in Push API?
Rishul Matta
  • 3,383
  • 5
  • 23
  • 29
18
votes
4 answers

Encrypt message for Web Push API in Java

I'm trying to create a server capable of sending push messages using the Push API: https://developer.mozilla.org/en-US/docs/Web/API/Push_API I've got the client side working but now I want to be able to send messages with a payload from a Java…
joaomgcd
  • 5,287
  • 4
  • 28
  • 39
18
votes
2 answers

How can I do push notifications in an HTML5 Web application?

I have a web application. I want to use the HTML 5 inbuilt notifications API to do push notifications from the server when the user is on a particular page. Is it possible?
Vickrant
  • 1,233
  • 2
  • 9
  • 15
14
votes
2 answers

Make Web push notification work using webview in a native android app?

I have a website which is responsive and push notification feature enabled. In my native android app, if i load my website in a WebView, then the pop up which usually comes in chrome/firefox to ask if user wants to allow push notification or not,…
Sash_KP
  • 5,551
  • 2
  • 25
  • 34
12
votes
1 answer

Google Chrome Silent Push Notifications

I've been reading through the docs for Chrome's implementation of the Web Push API here, and I noticed the API says "you promise to show a notification whenever you receive a push" and under limitations it's stated "you have to show a notification…
11
votes
3 answers

Web Push API - storing subscriptions in backend

I've implemented a Web Push API with the help of this Google tutorial: https://developers.google.com/web/fundamentals/getting-started/codelabs/push-notifications/ The tutorial includes a method, which could be used to send the subscription to a…
AndrejDelany
  • 423
  • 4
  • 18
11
votes
7 answers

PushManager subscription promise never fulfill nor reject

I am currently facing an issue with some Chrome (Chromium) version where the PushManager.subscribe promise from a ServiceWorker stays in a pending state. The code itself is pretty simple : return serviceWorkerRegistration.pushManager.subscribe({ …
Arturo
  • 213
  • 1
  • 3
  • 12
11
votes
1 answer

How to remotely dismiss notifications using web push notifications?

I am using push notifications on the web using the new service worker based API and have this use case: User opts in to receive notifications on multiple devices/platforms We send notifications to them on all devices/platforms User dismisses a…
owencm
  • 8,384
  • 6
  • 38
  • 54
10
votes
0 answers

How to check if a push endpoint is still valid?

I have successfully implemented HTML5 Push Notifications for my site, for news updates and user events. If an endpoint is no longer valid (for whatever reason, but generally because a user revoked permission in their browser) I get a 404 or 410…
MM.
  • 2,653
  • 4
  • 26
  • 36
10
votes
1 answer

GCM registration id in Service Worker in Push Notification for chrome

I am able to send push notification and in service worker i am making a service call i just to want to send GCM registration id with that service call. How to get registration id or subscription id in service worker here is my code…
9
votes
2 answers

How to do feature detection for Web Push?

Is there any easy way to feature detect Web Push API in browsers (Desktop and mobile)
Prashant Agrawal
  • 660
  • 9
  • 24
9
votes
3 answers

Refresh scripts imported with importScripts in service worker

I have a website which has a service worker like: // Import a script from another domain importScripts('https://example.com/script.js') Suppose that script.js is updated with some new code and the service worker is activated due to a push event…
collimarco
  • 34,231
  • 36
  • 108
  • 142
1
2 3 4 5 6 7 8