Last active
December 14, 2015 01:08
-
-
Save helpshift/5003608 to your computer and use it in GitHub Desktop.
Android SDK v1 gists 2.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String action = intent.getAction(); | |
if (action.equals(PushManager.ACTION_REGISTRATION_FINISHED)) { | |
hs.setDeviceToken(UAirship.shared().getApplicationContext(), | |
PushManager.shared().getAPID()); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String action = intent.getAction(); | |
if (action.equals(PushManager.ACTION_NOTIFICATION_OPENED)) { | |
if(intent.getExtras().getString("origin").equals("helpshift")) { | |
hs.showSupportOnPush(UAirship.shared().getApplicationContext(), | |
intent); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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