10
10
import com .instabug .library .Instabug ;
11
11
import com .instabug .library .InstabugColorTheme ;
12
12
import com .instabug .library .invocation .InstabugInvocationEvent ;
13
+ import android .graphics .Color ;
13
14
14
15
import java .util .ArrayList ;
15
16
import java .util .Collections ;
@@ -24,11 +25,37 @@ public class RNInstabugReactnativePackage implements ReactPackage {
24
25
private InstabugInvocationEvent invocationEvent = InstabugInvocationEvent .FLOATING_BUTTON ;
25
26
private InstabugColorTheme instabugColorTheme = InstabugColorTheme .InstabugColorThemeLight ;
26
27
27
- public RNInstabugReactnativePackage (String androidApplicationToken , Application androidApplication ) {
28
+ public RNInstabugReactnativePackage (String androidApplicationToken , Application androidApplication ,
29
+ String invocationEventValue , String primaryColor ) {
28
30
this .androidApplication = androidApplication ;
29
31
this .mAndroidApplicationToken = androidApplicationToken ;
32
+
33
+ //setting invocation event
34
+ if (invocationEventValue .equals ("button" )) {
35
+ this .invocationEvent = InstabugInvocationEvent .FLOATING_BUTTON ;
36
+ } else if (invocationEventValue .equals ("swipe" )) {
37
+ this .invocationEvent = InstabugInvocationEvent .TWO_FINGER_SWIPE_LEFT ;
38
+
39
+ } else if (invocationEventValue .equals ("shake" )) {
40
+ this .invocationEvent = InstabugInvocationEvent .SHAKE ;
41
+
42
+ } else if (invocationEventValue .equals ("screenshot" )) {
43
+ this .invocationEvent = InstabugInvocationEvent .SCREENSHOT_GESTURE ;
44
+
45
+ } else if (invocationEventValue .equals ("none" )) {
46
+ this .invocationEvent = InstabugInvocationEvent .NONE ;
47
+
48
+ } else {
49
+ this .invocationEvent = InstabugInvocationEvent .SHAKE ;
50
+ }
51
+
52
+
30
53
mInstabug = new Instabug .Builder (this .androidApplication , this .mAndroidApplicationToken )
54
+ .setInvocationEvent (this .invocationEvent )
31
55
.build ();
56
+
57
+ Instabug .setPrimaryColor (Color .parseColor (primaryColor ));
58
+
32
59
}
33
60
34
61
@ Deprecated
0 commit comments