Created
December 26, 2012 07:32
-
-
Save helpshift/4378705 to your computer and use it in GitHub Desktop.
Helpshift Android UA
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
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