narkis narkis - 10 months ago 81
Android Question

gcmsender error: MismatchSenderId

I am testing the updated google gsm cloud services with their sample app
and I am following google tutorial here:

the device client is set up, I am receiving the token and I already have the google-services.json downloaded and configured on the my developer console.

I understand that the API key is used by the gcmsender module to send a test message, however I receive an error:
I have confirmed that the google-services.json is using the same sender id as was supplied to me by the developer console.
What am I missing?

Answer Source

Please run below script in your terminal

curl -X POST \
-H "Authorization: key= write here api_key" \
-H "Content-Type: application/json" \
-d '{
"registration_ids": [ "write here reg_id generated by gcm"], "data": { "message": "Manual push notification from Rajkumar" }, "priority": "high"
}' \

MismatchSenderId because with in same device you have logged with different keys. to solve this problem uninstall app and run it againg and update the registration key. and then run the CURL script in your teminal which i post above it will give success message and you will get notification to your device