Firebase on iPad Safari Unable to find variable: Notification

I use Firebase cloud messaging, but it will not work on iPad and iPhone. This is the easiest use I can make with it. I just did the whole tutorial about external notifications, but I got this error directly in the Firebase script enter image description here .

+4
javascript firebase firebase-cloud-messaging
source share
2 answers

The firebase JavaScript library you are using is not compatible with Safari on iOS. The Safari browser running on iOS devices is different from the desktop build of the application and does not have the same set of features.

In this particular case, iOS Safari throws an error in your firebase.js library, trying to use the requestPermission () method of the web notification API to allow firebase to show notifications to the user. The Notification API does not exist though.

You can see the notification API support here: http://caniuse.com/#search=Notification

You may need to look for an alternative or disable the firebase library when your web application is viewed on mobile devices that do not support it. If it should work on iOS Safari, then you should indicate a bug with Firebase and see if there is a patch or update available that fixes the problem in the firebase.js library.

+6
source share

I have a response from Firebase Support:

Hi,

I hope you are doing well and thank you for contacting us. FCM web API only supports the following browsers, and Safari is not one of them: Chrome: 50+ Firefox: 44+ Opera Mobile: 37+ We are studying for potential solutions, but at the moment we have no details. If you have any other questions or clarifications, just let us know. We will try to help.

Regards, Resty

-one
source share

All Articles