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
1
vote
1 answer

Why are application server keys needed for web push notifications?

I was going through the Code Lab for web push notifications, which mentions that application server keys (public and private key pair) are required. Why do we need application server keys for push notifications? How can we generate them? Is it…
Jagajit Prusty
  • 2,070
  • 2
  • 21
  • 39
1
vote
3 answers

How subscribe pushManager via iframe in Chrome?

I can register service worker via iframe. When I try to run "pushManager.subscribe" I have: DOMException: Registration failed - permission denied This problem is only in Chrome via iframe. It works good in Firefox. And it works good without iframe…
1
vote
0 answers

PushManager endpoint contains "undefined"

While using the serviceWorkerRegistration.pushManager.subscribe method from a ServiceWorker, the created endpoint sometimes contains an "/undefined" at the end of the string. For example, through a Chrome ServiceWorker :…
Arturo
  • 213
  • 1
  • 3
  • 12
1
vote
1 answer

how to identify the right persistent data in a service worker?

I have a service worker within chrome that display push notifications when a users friends come online. I am looking to use IndexedDB to hold the data about the users friends e.g. name and URL to friends profile page. My problem is that one user has…
Wairowe
  • 205
  • 2
  • 6
1
vote
2 answers

Use data from Push in Web Push Notifications

I am trying to setup a demo for Web Push Notifications using Service Workers. In the service worker, sw.js, I have the following code. var title = 'Yay a message.'; var body = 'We have received a push message.'; var icon = 'icon.png'; var tag =…
Samarth Agarwal
  • 2,044
  • 8
  • 39
  • 79
1
vote
1 answer

Chrome Push Notifications how to retrieve push data?

I'm following this tutorial by Gooogle: https://developers.google.com/web/updates/2015/03/push-notifications-on-the-open-web I've tried but don't know how to get the data in the push notification. self.addEventListener('push', function(event) { …
1
vote
2 answers

How to implement service worker?

I have already been through different blogs explaning about service worker , one of them is open Web Push notification. I followed the instructions in Open Web Push notification and implemented a code which creates a curl registration id.Once the…
trupti
  • 413
  • 1
  • 6
  • 11
1
vote
1 answer

Multiple Chrome push notifications automatically closes except the last one

I have a Service Worker that fetches multiple notifications from the server. The problem is all notifications in Chrome automatically closes except the last one. What am I doing wrong? self.addEventListener('push', function(event) { var…
bruha
  • 2,505
  • 1
  • 22
  • 21
1
vote
2 answers

Open Chrome Web App using GCM

I am able to send a message to a Chrome Web App using GCM. I am using a http post to: https://android.googleapis.com/gcm/send sending registrationid, applicationid, and senderid values. The message shows as a Chrome Notification on my screen. …
obautista
  • 3,517
  • 13
  • 48
  • 83
1
vote
1 answer

Google Cloud Messaging for Chrome Web Push Notifications Issues

All of my questions are in context of Chrome Web Push Notifications, as released in Chrome Version 42. 1) GCM API returns 'Success' for even those Registration IDs which are no longer valid. When a person right clicks on the notification, and clicks…
1
vote
1 answer

ServiceWorker Chrome Push Notifications - Forward to new page

What I'm trying to do is see if a tab to my website is open in Chrome, and if so focus on it AND forward them to a new URL that I'm passing through. For reference, when you see "event.notification.data" it will be a link such as…
user1532606
1
vote
1 answer

Push Notifications on Chrome - Is it possible to have multiple recipients on same browser?

Scenario - I log into account A on Chrome and enable push notifications for new messages. Works fine. I logout and login to account B on same browser. I want push notifications for account B when I am logged into account B. Gmail does that when…
1
vote
2 answers

What technologies behind Web Push?

I was wondering what kind of technologies are behind Web Push, for example https://goroost.com How is that working? How to configure my server for Web Push? What should I look at?
0
votes
0 answers

Chrome extension with Firebase Cloud Messaging API: Defualt notification on msedge

I have programmed an Chrome Extension with Manifest Version 3, and it works very well in chrome with no problems. I use Firebase Cloud Messaging API V1 to get messages from my server to clients. However the problem is that when i use the extensions…
0
votes
0 answers

Web-push fcm endpoint 404: Requested URL not found on this server

I am subscribing users to web-push notifications. I have followed the documentation on web.dev. When I try to send a web-push message through my backend service(using rust web-push crate) to push-service endpoints, FCM or chrome returns 404 page not…