It seems that PWA push notifications on iOS are sometimes being revoked outside of user interaction. In the event handler, when we check the service worker registration for an active push subscription via ServiceWorkerRegistration.pushmanager.getSubscription(), and sometimes it reports null, indicating that the push subscription which was just used to receive a message is now no longer active. We had seen 1 such case recently. We would like to know how & when this happens. This is a fail for PWA push notifications on iOS, especially given that the pushsubscriptionchange event is not supported. Reference: https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerGlobalScope/pushsubscriptionchange_event . Could you please take a look?
@Thawfeeq - do you have minimal test case or you have any theory on why you think this is happening e.g., Intelligent Tracking Protection? Also which version of iOS, you are referring (iOS 17.4.1)? Appreciate if you can share more details and context. I have only found this one more thread but also without more context - https://developer.apple.com/forums/thread/727372
iOS VERSION - 17.4.1 Browser- Safari We haven't identified an exact reproducible scenario - as this has been reported by only a few users.
We are currently trying to identify the patterns which can lead to this behaviour.. I see such issues reported in apple forums - but no solid solution yet. Also I see that PushSubscriptionChange event ( https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerGlobalScope/pushsubscriptionchange_event ) , which is used for handling such scenarios , is not supported for mobile devices at all.
<rdar://problem/127225883>
We don't fire PushSubscriptionChangeEvent, and the last time I checked (which was admittedly several years ago), no other browsers did either. The IDL is in the repo but is otherwise unused. I'm not sure we can do much without a sysdiagnose (which you can include via a Feedback Assistant report). We did fix a number of bugs with Web Push on iOS recently (which should be in 17.5 RC), but the bugs weren't in WebKit but rather in Web.app, e.g. bugs where Web.app would handle the push, but then tell WebKit that the website didn't have permissions anymore, which would then result in the subscription being deleted. Can you try reproing on 17.5 RC and/or filing a Feedback Assistant report with a sysdiagnose?
After updating to 17.6 I had to resubscribe again, otherwise Notifications where not delivered. Unfortunately no further information yet.