firebase / firebase/firebase-admin-dotnet

Declarative Web Push support? "web_push" additional field support

Open
#488 2 comments 0 reactions 0 assignees View on GitHub
needs-triage
Dominant language
C#
Stars
408
Forks
146
Avg merge
22h 7m
Merged PRs (30d)
1

Description

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 https://github.com/firebase/firebase-js-sdk/issues/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:

```json
{
"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](https://youtu.be/4dJE4HjNOL4?si=p8JaQuDT1Oj7geN-).

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.