How to get the registration ID for Google Cloud Messenger

advertisements

I need to get the registration Id for GCM push notification implementation? Since I am using the GoogleCloudMessaging class but I am not getting the ID.


Use the GoogleCloudMessaging class with the register function sending your senderId that you got from the google developer Api console.

GoogleCloudMessaging gcm = GoogleCloudMessaging.getInstance(context);
String regid = gcm.register(senderId);