Jishnu Chandran
Jishnu Chandran

Reputation: 137

Firefox notification return InvalidRegistration FCM

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

Answers (1)

collimarco
collimarco

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:

  • deal with the different services
  • use a service that provides a layer of abstraction, so that you deal with just one API: check out Pushpad for example (I am the founder)

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

Related Questions