Reputation: 1077
When I am sending notification from Parse Push it send notification to some devices and for the rest it shows GCM- Mismatch sender id. I have configured Parse configuration properly in my app but sometime It store my app generated GCM ID in it's device token field and then giving this GCM- Mismatch sender ID error. How to resolve this error?
Upvotes: 3
Views: 767
Reputation: 6170
Likely your app uses more than one push provider including Parse. Fortunately Parse has provided a good meta-data. As Parse said in it's docs you should provide each Sender_ID that your app uses to push messages, if you use another push provider in addition to Parse. Take a look at below:
The Parse Android SDK chooses a reasonable default configuration so that you do not have to worry about GCM registration ids, sender ids, or API keys. In particular, the SDK will automatically register your app for push at startup time using Parse's sender ID (1076345567071) and will store the resulting registration ID in the deviceToken field of the app's current ParseInstallation.
However, as an advanced feature for developers that want to send pushes from multiple push providers, Parse allows you to optionally register your app for pushes with additional GCM sender IDs. To do this, specify the additional GCM sender ID with the following
<meta-data>
tag as a child of the<application>
element in your app's AndroidManifest.xml:<meta-data android:name="com.parse.push.gcm_sender_id" android:value="id:YOUR_SENDER_ID" />;
In the sample snippet above, YOUR_SENDER_ID should be replaced by a numeric GCM sender ID. Note that the Parse SDK expects you to prefix your sender ID with an id: prefix, as shown in the sample snippet.
If you want to register your app with multiple additional sender IDs, then the android:value in the
<meta-data>
element above should hold a comma-delimited list of sender IDs, as in the following snippet:<meta-data android:name="com.parse.push.gcm_sender_id" android:value="id:YOUR_SENDER_ID_1,YOUR_SENDER_ID_2,YOUR_SENDER_ID_3"/>;
Upvotes: 0