Last active
December 24, 2015 01:19
-
-
Save mediavrog/6722710 to your computer and use it in GitHub Desktop.
Setup Crittercism
This file contains 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
/*###################### | |
* Crittercism | |
* crittercism.com | |
######################*/ | |
JSONObject crittercismConfig = new JSONObject(); | |
JSONObject crittermeta = new JSONObject(); | |
try { | |
crittermeta.put("screen_name", "" + screen_name); | |
crittermeta.put("user_id", "" + user_id); | |
} catch (Exception e) { | |
e.printStackTrace(); | |
Tracking.logException(e); | |
} | |
try { | |
crittercismConfig.put("delaySendingAppLoad", true); | |
if (debugFlag) { | |
crittercismConfig.put("customVersionName", versionName); | |
} | |
} catch (Exception e) { | |
e.printStackTrace(); | |
Tracking.logException(e); | |
} | |
Crittercism.init(ctx.getApplicationContext(), CRITTERCISM_KEY, crittercismConfig); | |
// only add username and id if we have a logged in user, otherwise let crittercism decide on a guest name | |
if (screen_name != null && user_id != null && !"".equals(screen_name) && !"".equals(user_id)) { | |
Crittercism.setUsername(screen_name + " - " + user_id); | |
} | |
Crittercism.setMetadata(crittermeta); | |
Crittercism.sendAppLoadData(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment