Enabling Google Cloud Messaging (GCM) on Android App

The detailed documentation from Google can be found at


In the method below (as referenced in the URL above),  send the GCM registration data to MACH using the sample below:


private void sendRegistrationIdToBackend() {

    // Send your GCM registration data to the MACH URL,

//as described in the MACH API Guide. Sample code below:
ConnectionTask task = new ConnectionTask(this);
String[] params = new String[1];
params[0] = ConstantsAndUtilities.MACH_GENERIC_REG_URL+"?"+
"PushToken="+ regid+"&"+
"Custom1="+ getAccountPhoneNumber(); // get from database next time.
Log.w("Generic MACH","Posting..:"+params[0]);




To send a Push message to your Android device, you can use the Broadcast feature on the MACH Portal.



Please sign in to leave a comment.