Created
November 16, 2017 15:12
Star
You must be signed in to star a gist
Instabug initialize
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
/*** | |
* 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