Skip to content

Declarative Web Push support? "web_push" additional field support #488

@andynewman10

Description

@andynewman10

Any idea about how to format the message to make it compliant with Declarative Web Push?

It only is a minor update to how messages should be formatted, but I don't see how this can be performed with your library (which is excellent work, otherwise).

Sending Declarative Web Push-compliant messages is required for Safari not to drop push subscriptions after some time automatically (see firebase/firebase-js-sdk#8010). Note this behavior, nicknamed Intelligent Tracking Prevention (ITP), may happen with macOS Safari, not just with iOS. Basically, the client service worker may be killed anytime on client machines, and because of that, incoming notifications can no longer be displayed... unless there is a specific field in the payload indicating to the browser it has a green light to display a notification by itself, without even going through the service worker:

{
  "web_push": 8030, // makes push message Declarative Web Push-compliant
  "notification": {
    "title": "...",    
    "body": "...",    
  }
}

A short but good video about the subject, made by Apple, is provided here.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions