Question

All,

I'm probably asking a very basic question here, but how does one get your device ID for PushSharp in Android? My setup is VB.net, and we'll be sending to a large number of different Android devices. Following the PushSharp example here is my code so far:

push.RegisterGcmService(new 
GcmPushChannelSettings("YOUR Google API's Console API Access  API KEY for Server Apps HERE"));
push.QueueNotification(new GcmNotification().ForDeviceRegistrationId(
"DEVICE REGISTRATION ID HERE")
 .WithJson("{\"alert\":\"Hello World!\",
 \"badge\":7,\"sound\":\"sound.caf\"}"));

I know the API key is from the GCM service, but where does the Device Registration ID come from? Is that setup by the GCM service? Or is that something the android device sends the server should save?

Thanks for the help.

Was it helpful?

Solution

The registration ID is assigned by the GCM service. When the application registers to GCM, it gets a registration ID and should send it to the server.

Registration ID An ID issued by the GCM servers to the Android application that allows it to receive messages. Once the Android application has the registration ID, it sends it to the 3rd-party application server, which uses it to identify each device that has registered to receive messages for a given Android application. In other words, a registration ID is tied to a particular Android application running on a particular device.

You can read more about it here.

OTHER TIPS

In case you ended up reading this post and could not get yourself sorted out with the selected answer, here is the ultimate link that helped me:

Getting a GCM registration ID

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top