Skip to content

Instantly share code, notes, and snippets.

@helpshift
Created December 26, 2012 07:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save helpshift/4378705 to your computer and use it in GitHub Desktop.
Save helpshift/4378705 to your computer and use it in GitHub Desktop.
Helpshift Android UA
String action = intent.getAction();
if (action.equals(PushManager.ACTION_REGISTRATION_FINISHED)) {
hs.setDeviceToken(UAirship.shared().getApplicationContext(),PushManager.shared().getAPID());
}
if (action.equals(PushManager.ACTION_NOTIFICATION_OPENED)) {
if(intent.getExtras().getString("origin").equals("helpshift")) {
hs.showSupportOnPush(UAirship.shared().getApplicationContext(), intent);
}
}
public Notification buildNotification(String alert, Map<String, String> extras) {
Context c = UAirship.shared().getApplicationContext();
if(!hs.isForeground(c)) {
return super.buildNotification(alert, extras);
} else {
return null;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment