Zuliox
Zuliox

Reputation: 11

Android C2DM, Sender ID in the Push App

The Android C2DM push app that I have developed has the reference of my sender is (example: "[email protected]") in the application side code. Case 1: When I install this app on a Android device, the device has a gmail id as "[email protected]" in Accounts and Sync settings. App is registered successfully with C2DM but it does not receive any of the pushed messages.

Case2: When I use the same sender id ("[email protected]") in the Android device's Accounts and Sync. I receive all the messages that I push.

Why case 1 is failing and case 2 (sender id all through) is successful?

Upvotes: 1

Views: 2916

Answers (2)

Raul Rene
Raul Rene

Reputation: 10270

This is the way that C2DM works. It makes sense that it works in this way since it requires the email address for both the registration id and authentication token.

When sending a push message, your third party server uses the registration id built on (probably) "[email protected]", and authentication token built on the same email. Google's server looks on your device and tries to find that specific email address account. You can have multiple accounts on the device, but at least one of them has to be the account used to register the device.

Why would Google ask for the email anyway if it wouldn't have mattered? It would have been much easier to use directly the device's unique id.

Upvotes: 0

Chirag_CID
Chirag_CID

Reputation: 2224

Please make sure that you have signed out from built in gtalk application of your phone, if you are not signed out from gtalk app, then it will create ambiguity in between gtalk and ur personal app for messaged pushed from google server so it can not send message to any app and give exception.

For detailed information of push notification , please check https://developers.google.com/android/c2dm/

best c2dm tutorialis ,http://www.vogella.com/articles/AndroidCloudToDeviceMessaging/article.html

Upvotes: 0

Related Questions