Skip to content

Commit 3f9769f

Browse files
committed
✨ [Android] Added InvocationEvent Enum Mapping
1 parent 33a441e commit 3f9769f

File tree

1 file changed

+23
-2
lines changed

1 file changed

+23
-2
lines changed

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

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,21 @@
1111
import com.instabug.library.Instabug;
1212
import com.instabug.library.invocation.InstabugInvocationEvent;
1313

14+
import java.lang.reflect.Array;
15+
import java.lang.reflect.InvocationTargetException;
16+
import java.lang.reflect.Method;
17+
import java.lang.reflect.Parameter;
1418
import java.util.ArrayList;
1519
import java.util.Arrays;
1620
import java.util.Collections;
21+
import java.util.HashMap;
22+
import java.util.Iterator;
1723
import java.util.List;
24+
import java.util.Map;
25+
26+
import android.os.Handler;
27+
import android.os.Looper;
28+
import android.util.Log;
1829

1930
// import com.instabug.library.InstabugColorTheme;
2031
// import com.instabug.library.InstabugCustomTextPlaceHolder;
@@ -23,8 +34,9 @@
2334

2435
/** InstabugFlutterPlugin */
2536
public class InstabugFlutterPlugin implements MethodCallHandler {
26-
27-
private ArrayList<InstabugInvocationEvent> invocationEvents = new ArrayList<>();
37+
38+
39+
private Map<String, Object> constants = getConstants();
2840

2941
/** Plugin registration. */
3042
public static void registerWith(Registrar registrar) {
@@ -65,4 +77,13 @@ public void start(Application application, String token) {
6577
new Instabug.Builder(application, token).build();
6678
}
6779

80+
public Map<String, Object> getConstants() {
81+
final Map<String, Object> constants = new HashMap<>();
82+
constants.put("InvocationEvent.none", InstabugInvocationEvent.NONE);
83+
constants.put("InvocationEvent.screenshot", InstabugInvocationEvent.SCREENSHOT);
84+
constants.put("InvocationEvent.twoFingersSwipeLeft", InstabugInvocationEvent.TWO_FINGER_SWIPE_LEFT);
85+
constants.put("InvocationEvent.floatingButton", InstabugInvocationEvent.FLOATING_BUTTON);
86+
constants.put("InvocationEvent.shake", InstabugInvocationEvent.SHAKE);
87+
return constants;
88+
}
6889
}

0 commit comments

Comments
 (0)