0

using firebase messaging.It works on chrome, firefox but not working on Microsoft edge and safari browser.

The error raised in the console is : FirebaseError: Messaging: This browser doesn't support the API's required to use the firebase SDK. (messaging/unsupported-browser).

what i'm getting wrong code is:

var config = {
  apiKey: "xxx",
  authDomain: "xxx.firebaseapp.com",
  databaseURL: "https://xxx.firebaseio.com",
  projectId: "xxx",
  storageBucket: "xx.appspot.com",
  messagingSenderId: "xxxxx"
};
firebase.initializeApp(config);
const messaging = firebase.messaging();
messaging.onMessage(function(payload){
var resp = JSON.parse(payload.data.notification);
var board_id = resp.boardId;
  var notificationTitle = resp.title;
  var notificationOptions = {
    body: resp.body,
    icon: resp.icon
  };})
Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
Sohail Ahmad
  • 7,309
  • 5
  • 27
  • 46
  • 1
    The error message is pretty explicit. Firebase Cloud Messaging is not supported in Safari, since it doesn't support the Push API. See https://caniuse.com/#feat=push-api, https://firebase.google.com/docs/cloud-messaging/js/client and https://stackoverflow.com/questions/45555067/push-notifications-in-apple-safari-with-fcm – Frank van Puffelen Mar 19 '19 at 14:15
  • Possible duplicate of [Push notifications in Apple Safari with FCM](https://stackoverflow.com/questions/45555067/push-notifications-in-apple-safari-with-fcm) – Frank van Puffelen Mar 19 '19 at 14:16
  • Thanks for response. is there any other solution – Sohail Ahmad Mar 20 '19 at 07:01
  • @SohailAhmad Have you got solution ? – Manish Patidar Jun 17 '20 at 09:35

0 Answers0