Skip to content

Instantly share code, notes, and snippets.

@kapilreddy
Forked from nayansuthar/application-tags.xml
Last active October 13, 2015 12:27
Show Gist options
  • Save kapilreddy/4195547 to your computer and use it in GitHub Desktop.
Save kapilreddy/4195547 to your computer and use it in GitHub Desktop.
helpshift initialization android
<activity android:name="com.helpshift.HelpshiftActivity" android:theme="@style/HSBottomAnimTheme" />
<activity android:name="com.helpshift.HSAddIssue" android:theme="@style/HSRightAnimTheme" />
<activity android:name="com.helpshift.HSAddProfile" android:theme="@style/HSRightAnimTheme" />
<activity android:name="com.helpshift.HSMessages" android:theme="@style/HSRightAnimTheme" />
<activity android:name="com.helpshift.HSQuestionsList" android:theme="@style/HSRightAnimTheme" />
<activity android:name="com.helpshift.HSQuestion" android:configChanges="orientation|screenSize" android:theme="@style/HSRightAnimTheme" />
hs.clearBreadCrumbs();
hs.leaveBreadCrumb("Went to Preferences Screen");
private Handler countHandler = new Handler() {
public void handleMessage(Message msg) {
super.handleMessage(msg);
Log.d("Notification Count", msg.toString());
}
};
hs.install(this,
"<YOUR_API_KEY>",
"<yourcompany>.helpshift.com",
"<YOUR_APP_ID>");
final Helpshift hs = new Helpshift();
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;
}
}
String action = intent.getAction();
if (action.equals(PushManager.ACTION_REGISTRATION_FINISHED)) {
hs.setDeviceToken(UAirship.shared().getApplicationContext(),
PushManager.shared().getAPID());
}
String action = intent.getAction();
if (action.equals(PushManager.ACTION_NOTIFICATION_OPENED)) {
if(intent.getExtras().getString("origin").equals("helpshift")) {
hs.showSupportOnPush(UAirship.shared().getApplicationContext(),
intent);
}
}
hs.setDeviceIdentifier("user-id-100");
hs.setUsername("John");
hs.setEmail("john@helpshift.com");
<uses-permission android:name="android.permission.INTERNET" />
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17" />
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment