Push notifications in Apple Safari with FCM
While worker services are working on Safari, there aren't enough of them.
The documentation says:
The FCM JavaScript API allows you to receive notifications in web applications that run on browsers that support the Push API . This includes the browser versions listed in this support matrix .
Safari does not support web push , which FCM uses to support the browser. This means Safari cannot receive FCM notifications.
source to share
I'm not sure about this new Safari and Service Workers situation, but I tried to implement FCM push notifications in my iOS app and had to first make sure you need an APN (Apple-Push-Notification) certificate. I'm not sure if this is necessary if you are working with Safari, but I could imagine that Apple also wants it to notify redirect notifications to APN servers first.
source to share
Safari still doesn't support the Web Push API, so the Firebase Cloud Messaging.
Here are the supported browsers in Firebase: https://firebase.google.com/support/guides/environments_js-sdk#browsers
I would suggest using .isSupported()
instead of other solutions.
if (firebase.messaging.isSupported())
const messaging = firebase.messaging();
}
For more information about .isSupported()
, see. In documentation .
source to share