Skip to content

Instantly share code, notes, and snippets.

@Budincsevity
Last active August 29, 2015 14:21
Show Gist options
  • Save Budincsevity/0aba1287360b934a11f9 to your computer and use it in GitHub Desktop.
Save Budincsevity/0aba1287360b934a11f9 to your computer and use it in GitHub Desktop.
Registration with templates
//Register a new gcm ID
GoogleCloudMessaging gcm = GoogleCloudMessaging.getInstance(context);
String gcmID = gcm.register(SENDER_ID);
//New NotificationHub instance
NotificationHub hub = new NotificationHub("<hub name>", "<connection string>", context);
String template = "{ \"data\" : {\"msg\":\"$(message)\"}}";
//Register your gcm ID with NotificationHub
NativeRegistration registration = hub.registerTemplate(gcmID, "Template1", template, tag);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment