GCM different sender id with mismatchsender id err

2019-07-10 18:38发布

问题:

I used two different sender ids with two different applications. When I send message first app to second app it is successful, but when I send second app to first I get :

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

回答1:

The API key you are using to send the messages is tied to a Google API project ID. That project ID is used to register your app to GCM. The registration ID you get when registering your app is tied to that project ID.

Now, if you send a GCM message using API key of project ID A with a Registration ID tied to project ID B, you'll get MismatchSenderId.

You didn't specify if you used the same API key to send messages to both apps and you didn't specify if you used the same project ID to register the two apps to GCM, so it's hard to explain the specific behavior you observed, but my general explanation should point you in the right direction.



回答2:

I have used same sender id for both two application they have also different package name. Not required to create different sender id for different application.Also used same api key for server side