I'm implementing a push notification server with GCM. I send a post request with a sender ID (application key) that I got from Google API Console, and a registration ID that I got from the GCM service.
The posted JSON includes one registration ID. I always get the same response:
{ "multicast_id":8546528660791862014, "success":0, "failure":1, "canonical_ids":0, "results":[ { "error":"MismatchSenderId" } ] }
What might be the problem? What am I doing wrong?
FCM is a cloud platform that provides messages and push notifications for operating systems- ios and Android, and websites as well. Google Cloud Messaging is a messaging service that enables the message transfer from server to clients apps.
Google Cloud Messaging (GCM) was a mobile notification service developed by Google that enables third-party application developers to send notification data or information from developer-run servers to applications that target the Google Android Operating System, as well as applications or extensions developed for the ...
Sender ID. A unique numerical value created when you create your Firebase project, available in the Cloud Messaging tab of the Firebase console Settings pane. The sender ID is used to identify each sender that can send messages to the client app.
Please uninstall your Android app from the device and run the app again.
Now you will get a new registration Id. That may solve your MismatchSenderId problem in a specific case (Sometimes it happens If you change/refresh your API key, but still using the old registration key). In my case, I got the registration Id first for my device and then I changed my API Key (on Google GCM server) and then I got MismatchSenderId error. Finally, I uninstalled my Android app from the device and the problem got solved.
See the Stack Overflow post Why do I get "MismatchSenderId" from GCM server side?.
From the URL above:
double check the Sender ID and API_KEY, they must match or else you will get that MismatchSenderId error. In the Google API Console, look at the URL of your project:
https://code.google.com/apis/console/#project:xxxxxxxxxxx
The xxxxxxxxx is the project ID, which is the sender ID.
Some people are reporting issues using the "Key for Server Apps" type of keys, but having success using the Browser Key type instead. Personally, the Server Key type works for me, but try both, YMMV.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With