Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save CHLibrarian/0e3b504ba329611a5d4b to your computer and use it in GitHub Desktop.

Select an option

Save CHLibrarian/0e3b504ba329611a5d4b to your computer and use it in GitHub Desktop.
ContextHub Application Services Register Push (Android)
public class NotifyMeApp extends Application {
@Override
public void onCreate() {
super.onCreate();
// Register with ContextHub
ContextHub.init(this, "YOUR-APP-ID-HERE");
/* Initialize push service with your GCM sender id, the device alias,
tags, the activity to launch when a notification is opened, and a
custom notification handler */
String[] tags = new String[]{"tag-1", "tag-2"};
Push.init(this, "YOUR-GCM-PROJECT-ID-HERE", "My Device", tags, MainActivity.class, new MyNotificationHandler());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment