Skip to content

Commit 748295e

Browse files
committed
✨ [Android] Added startWithToken API
1 parent ee26c9c commit 748295e

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

android/src/main/java/com/instabug/instabugflutter/InstabugFlutterPlugin.java

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@
3535
/** InstabugFlutterPlugin */
3636
public class InstabugFlutterPlugin implements MethodCallHandler {
3737

38+
final public static String INVOCATION_EVENT_NONE = "InvocationEvent.none";
39+
final public static String INVOCATION_EVENT_SCREENSHOT = "InvocationEvent.screenshot";
40+
final public static String INVOCATION_EVENT_TWO_FINGER_SWIPE_LEFT = "InvocationEvent.twoFingersSwipeLeft";
41+
final public static String INVOCATION_EVENT_FLOATING_BUTTON = "InvocationEvent.floatingButton";
42+
final public static String INVOCATION_EVENT_SHAKE = "InvocationEvent.shake";
3843

3944
private Map<String, Object> constants = getConstants();
4045

@@ -73,8 +78,13 @@ public void onMethodCall(MethodCall call, Result result) {
7378
result.notImplemented();
7479
}
7580
}
76-
public void start(Application application, String token) {
77-
new Instabug.Builder(application, token).build();
81+
82+
public void start(Application application, String token, ArrayList<String> invocationEvents) {
83+
InstabugInvocationEvent[] invocationEventsArray = new InstabugInvocationEvent[invocationEvents.size()];
84+
for (int i = 0; i < invocationEvents.size(); i++) {
85+
invocationEventsArray[i] = (InstabugInvocationEvent)constants.get(invocationEvents.get(i));
86+
}
87+
new Instabug.Builder(application, token).setInvocationEvents(invocationEventsArray).build();
7888
}
7989

8090
public Map<String, Object> getConstants() {

0 commit comments

Comments
 (0)