Reputation: 137
I am using FCM to Send Push notification,my code work fine on Chrome, but I'm struggling on Firefox. I got response like this
{"multicast_id":8241088978207626504,"success":0,"failure":1,"canonical_ids":0,"results":[{"error":"InvalidRegistration"}]} 0 .
my full API request shown below
https://fcm.googleapis.com/fcm/send
header
TTL: 60
User-Agent: Fiddler
Host: fcm.googleapis.com
Authorization: key=aBCABC-aBCABC
Content-Type: application/json
Content-Length: 250
body
{ "to": "gAAAAABYObKnhmk29O7z_ZeLomoG_7CwG6ZNUZpMz5SxB8XPizuUtNKYLyPMrMB7nR-IQo83L51DWvzAAqIau5c0LEWRE0CiwWO78Dn6JPwrVGqBqfZFJnHT1HuboZb9OrTdPknEXYvc", "data": { "hello": "This is a Firebase Cloud Messaging Device Group Message!", } }
But this code work fine on Android, please give any suggestion. Thanks
Upvotes: 4
Views: 2214
Reputation: 35390
You cannot use Firebase for Firefox. Firebase is just for Chrome.
When you send a push notification from a website you are using the Push API, which is a standard. Based on this standard, each browser manufacturer provides a push service for its browser. Firefox for example uses Mozilla autopush.
You have two options:
UPDATE: now Firebase has introduced support for Firefox. When you send a notification to Chrome the notification is delivered directly by Firebase to the browser. If you send the notification to Firefox, then Firebase behaves like any other push service (e.g. Pushpad, OneSignal, etc.) and forwards the notification to Mozilla autopush, which then delivers the notification to Firefox.
Upvotes: 4