Firebase Setup issue

Viewed 165
  • If i setup firebase account and add android application with package name "xyz213"

= It's not working with fcm push notification display error like 'mismatchsenderid'

============== Code ==================

{"multicast_id":5340432438815499122,"success":0,"failure":1,"canonical_ids":0,"results":[{"error":"MismatchSenderId"}]}

============= Code End ===================

  • If i setup firebase account and add android application with package name "xyz"

= It's working with fcm push notification

If anyone known the issue please tell me

1 Answers

MismatchSenderId error according to Firebase documentation means:

A registration token is tied to a certain group of senders. When a client app registers for FCM, it must specify which senders are allowed to send messages. You should use one of those sender IDs when sending messages to the client app. If you switch to a different sender, the existing registration tokens won't work.

Check the firebase project that your current android project is linked to and use server key from that project. Maybe you are using Server key from a different firebase project.

Make sure you are taking the Server Key from Right place. Now it is a little bit tricky to get Server key for Notification from firebase.

Check these steps :

GO TO CONSOLE => YOUR PROJECT => PROJECT SETTINGS => CLOUD MESSAGING (Second Tab)

And Take your Server Key and Sender id from there, which will work for you.

Set those in your app and sync project again.

Probably Google Services on your Android app has been configured incorrectly.

Log into Firebase console, open your project (click the gear icon). Under General tab, scroll down to "Download the latest config file" and click on the button to download google-services.json (which should include the correct project and sender ID)

Related