Firebase MismatchSenderID when Authorization key is my Server key

后端 未结 2 1580
旧巷少年郎
旧巷少年郎 2020-12-07 03:26

Really weird and no one has ever asked this.

I\'m getting MismatchSenderIdas an error with my server key as my authorization key(server key). And on the

相关标签:
2条回答
  • 2020-12-07 03:53

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

    Here are the Steps :

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

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

    Uninstall the App and Re install it and try it.

    0 讨论(0)
  • 2020-12-07 03:54

    The MismatchSenderId error is encountered when you are attempting to send to a registration token that is associated with a different Sender (Project). From the docs:

    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.

    Make sure that the Server Key you are using is from the same Sender Project that the registration token is associated to. You can do this by checking your google-services.json file and see if the Sender ID there matches the Sender ID visible in the Firebase Project you are using to send the message.

    For the matter of not receiving messages, It's a bit unclear as to what is the structure of payload that your code is sending. Try checking if it is a properly structured message payload with a notification and/or data message payload.

    0 讨论(0)
提交回复
热议问题