@@ -54,6 +54,9 @@ public class RNInstabugReactnativeModule extends ReactContextBaseJavaModule {
54
54
private final String INVOCATION_MODE_NEW_FEEDBACK = "feedback" ;
55
55
private final String INVOCATION_MODE_NEW_CHAT = "chat" ;
56
56
private final String INVOCATION_MODE_CHATS_LIST = "chats" ;
57
+ //FloatingButtonEdge
58
+ private final String FLOATING_BUTTON_EDGE_RIGHT = "right" ;
59
+ private final String FLOATING_BUTTON_EDGE_LEFT = "left" ;
57
60
//locales
58
61
private final String LOCALE_ARABIC = "arabic" ;
59
62
private final String LOCALE_CHINESE_SIMPLIFIED = "chinesesimplified" ;
@@ -526,6 +529,38 @@ private InstabugInvocationEvent getInvocationEventById(String invocationEventVal
526
529
}
527
530
}
528
531
532
+ /**
533
+ * Sets the default edge at which the floating button will be shown
534
+ *
535
+ * @param instabugFloatingButtonEdge edge to stick Floating button to
536
+ * @see InstabugFloatingButtonEdge
537
+ */
538
+
539
+ @ ReactMethod
540
+ public void setFloatingButtonEdge (String floatingButtonEdgeValue ) {
541
+ try {
542
+ mInstabug .setFloatingButtonEdge (getFloatingButtonEdge (floatingButtonEdgeValue ));
543
+ } catch (Exception e ) {
544
+ e .printStackTrace ();
545
+ }
546
+ }
547
+
548
+ private InstabugFloatingButtonEdge getFloatingButtonEdge (String floatingButtonEdgeValue ) {
549
+ InstabugFloatingButtonEdge floatingButtonEdge = InstabugFloatingButtonEdge .RIGHT ;
550
+ try {
551
+ if (floatingButtonEdgeValue .equals (FLOATING_BUTTON_EDGE_LEFT )) {
552
+ floatingButtonEdge = InstabugFloatingButtonEdge .LEFT ;
553
+ } else if (floatingButtonEdgeValue .equals (FLOATING_BUTTON_EDGE_RIGHT )) {
554
+ floatingButtonEdge = InstabugFloatingButtonEdge .RIGHT ;
555
+ }
556
+
557
+ return invocationEvent ;
558
+ } catch (Exception e ) {
559
+ e .printStackTrace ();
560
+ return invocationEvent ;
561
+ }
562
+ }
563
+
529
564
/**
530
565
* Enabled/disable chat notification
531
566
*
@@ -991,6 +1026,20 @@ public void setSurveysEnabled(boolean surveysEnabled) {
991
1026
}
992
1027
}
993
1028
1029
+ /**
1030
+ * Sets the default value of the intro message guide that gets shown on launching the app
1031
+ *
1032
+ * @param enabled true to show intro message guide
1033
+ */
1034
+ @ ReactMethod
1035
+ public void setIntroMessageEnabled (boolean enabled ) {
1036
+ try {
1037
+ mInstabug .setIntroMessageEnabled (enabled );
1038
+ } catch (Exception e ) {
1039
+ e .printStackTrace ();
1040
+ }
1041
+ }
1042
+
994
1043
995
1044
/**
996
1045
* Sets the runnable that gets executed just before showing any valid survey<br/>
@@ -1232,6 +1281,9 @@ public Map<String, Object> getConstants() {
1232
1281
constants .put ("invocationModeNewChat" , INVOCATION_MODE_NEW_CHAT );
1233
1282
constants .put ("invocationModeChatsList" , INVOCATION_MODE_CHATS_LIST );
1234
1283
1284
+ constants .put ("floatingButtonEdgeLeft" ,FLOATING_BUTTON_EDGE_LEFT );
1285
+ constants .put ("floatingButtonEdgeRight" ,FLOATING_BUTTON_EDGE_RIGHT );
1286
+
1235
1287
constants .put ("localeArabic" , LOCALE_ARABIC );
1236
1288
constants .put ("localeChineseSimplified" , LOCALE_CHINESE_SIMPLIFIED );
1237
1289
constants .put ("localeChineseTraditional" , LOCALE_CHINESE_TRADITIONAL );
0 commit comments