androidfirebasepush-notificationgoogle-cloud-messagingfirebase-cloud-messaging

FCM Push Notification: MismatchSenderId


Good day,

I am trying to use this URL from FCM to send messages:

https://fcm.googleapis.com/fcm/send

With a header of

    Authorization value of **key:*Key from Firebase Console***
    Content-Type: **application/json**

The body consist of this:

    {
       "to" : "MyKey generated",
       "notification" : {
       "body" : "Hey",
       "title" : "Hey"
    }  
 }

But the result i always received is this:

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

The server key I got is from here:

Server Key

My URL reference is the docs in FCM server.

I am testing this in Postman. Did I miss something? Thanks


Solution

  • According to 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.

    So it sounds like you are trying to send a push notification to an ID that is not associated with the sender ID. You should verify that you have the correct keys in the correct places