Commit 7dd9742
committed
fix: use legacy Safari push path only for existing legacy subscribers
Safari 16.4+ supports standard Web Push (VAPID), but
`window.safari.pushNotification` was never removed. The SDK checked
for API existence to decide the push path, which routed ALL macOS
Safari users through the legacy flow — even on versions that fully
support VAPID. When the legacy push package validation fails (e.g.
invalid allowedDomains), this causes the error:
"Safari url/icon/certificate invalid or in private mode"
Now `useSafariLegacyPush()` checks the actual permission state: only
users who have already granted legacy push (with a valid deviceToken)
stay on the legacy path. New users on Safari 16.4+ are routed through
the standard VAPID flow via `useSafariVapidPush()`.1 parent 354f504 commit 7dd9742
1 file changed
Lines changed: 21 additions & 2 deletions
File tree
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
23 | | - | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
24 | 43 | | |
25 | 44 | | |
26 | 45 | | |
| |||
0 commit comments