t1gor
t1gor

Reputation: 1292

Does PWA share web-push subscription with the browser?

I am currently working on the web-push notifications for a project and got a bit confused by the matter. I couldn't find any info on the topic, so please consider the following scenario:

  1. User subscribes for web-push notifications on m.example.com
  2. And then adds the page to home screen, e.g. installs PWA

So the questions are:

Upvotes: 6

Views: 329

Answers (1)

PeteLe
PeteLe

Reputation: 1945

On Chrome, yes, they are treated as the same, it doesn't matter how the user opens the PWA (home screen vs URL in a browser tab), it's the same experience, and data is shared between. And conversely, the subscription is the same no matter where the user subscribed from.

Safari does treat the installed vs browser tab as a different context and data is not shared between the two. But as abraham mention in the comments, Safari doesn't support web push, so it's kind of a moot point.

Upvotes: 3

Related Questions