Created
November 16, 2017 15:12
-
-
Save SeanZoR/f34a0893388438d823e40a068a2a6370 to your computer and use it in GitHub Desktop.
Instabug initialize
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
/*** | |
* Wrapper for instabug implementation | |
* API docs are (mostly) here: https://instabug.com/public/android-api-reference/com/instabug/library/Instabug.html | |
*/ | |
public class InstabugUtil { | |
public static void init(Application context) { | |
// Builder should run first | |
Instabug.Builder builder = new Instabug.Builder(context, context.getString(R.string.instabug_key)); | |
if (BuildConfig.DEBUG) { | |
builder.setInvocationEvent(InstabugInvocationEvent.SCREENSHOT_GESTURE); | |
} | |
builder.build(); | |
// Other configs | |
Instabug.setEmailFieldVisibility(false); | |
Instabug.setIntroMessageEnabled(false); | |
Instabug.setPromptOptionsEnabled(false, true, false); // chat, bug, feedback | |
Instabug.setDebugEnabled(true); | |
//Instabug.addTags(BuildConfig.);? | |
} | |
public static void setUser(String email, String driverId){ | |
Instabug.identifyUser(email, driverId); | |
} | |
public static void logoutUser(){ | |
Instabug.logoutUser(); | |
} | |
public static void invokeInstabugMenu() { | |
// Only Report a Problem option is available | |
Instabug.invoke(InstabugInvocationMode.NEW_BUG); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment