|
33 | 33 | import com.instabug.library.user.UserEventParam;
|
34 | 34 | import com.instabug.library.OnSdkDismissedCallback;
|
35 | 35 | import com.instabug.library.bugreporting.model.Bug;
|
| 36 | +import com.instabug.library.visualusersteps.State; |
36 | 37 | import com.instabug.survey.InstabugSurvey;
|
37 | 38 |
|
38 | 39 | import com.instabug.reactlibrary.utils.ArrayUtil;
|
@@ -93,6 +94,11 @@ public class RNInstabugReactnativeModule extends ReactContextBaseJavaModule {
|
93 | 94 | private final String EXTENDED_BUG_REPORT_OPTIONAL_FIELDS = "enabledWithOptionalFields";
|
94 | 95 | private final String EXTENDED_BUG_REPORT_DISABLED = "disabled";
|
95 | 96 |
|
| 97 | + //Instabug repro step modes |
| 98 | + private final String ENABLED_WITH_NO_SCREENSHOT = "enabledWithNoScreenshot"; |
| 99 | + private final String ENABLED = "enabled"; |
| 100 | + private final String DISABLED = "disabled"; |
| 101 | + |
96 | 102 | //Theme colors
|
97 | 103 | private final String COLOR_THEME_LIGHT = "light";
|
98 | 104 | private final String COLOR_THEME_DARK = "dark";
|
@@ -1226,6 +1232,34 @@ public void clearFileAttachment() {
|
1226 | 1232 | }
|
1227 | 1233 | }
|
1228 | 1234 |
|
| 1235 | + /** |
| 1236 | + * Sets whether user steps tracking is visual, non visula or disabled. |
| 1237 | + * |
| 1238 | + * @param reproStepsMode A string to set user steps tracking to be |
| 1239 | + * enabled, non visual or disabled. |
| 1240 | + */ |
| 1241 | + @ReactMethod |
| 1242 | + public void setReproStepsMode(String reproStepsMode) { |
| 1243 | + try { |
| 1244 | + switch(reproStepsMode) { |
| 1245 | + case ENABLED_WITH_NO_SCREENSHOT: |
| 1246 | + Instabug.setReproStepsState(State.ENABLED_WITH_NO_SCREENSHOTS); |
| 1247 | + break; |
| 1248 | + case ENABLED: |
| 1249 | + Instabug.setReproStepsState(State.ENABLED); |
| 1250 | + break; |
| 1251 | + case DISABLED: |
| 1252 | + Instabug.setReproStepsState(State.DISABLED); |
| 1253 | + break; |
| 1254 | + default: |
| 1255 | + Instabug.setReproStepsState(State.ENABLED); |
| 1256 | + } |
| 1257 | + |
| 1258 | + } catch (Exception e) { |
| 1259 | + e.printStackTrace(); |
| 1260 | + } |
| 1261 | + } |
| 1262 | + |
1229 | 1263 | /**
|
1230 | 1264 | * Sets the threshold value of the shake gesture for android devices.
|
1231 | 1265 | * Default for android is an integer value equals 350.
|
@@ -1474,6 +1508,10 @@ public Map<String, Object> getConstants() {
|
1474 | 1508 | constants.put("enabledWithOptionalFields", EXTENDED_BUG_REPORT_OPTIONAL_FIELDS);
|
1475 | 1509 | constants.put("disabled", EXTENDED_BUG_REPORT_DISABLED);
|
1476 | 1510 |
|
| 1511 | + constants.put("reproStepsEnabledWithNoScreenshot", ENABLED_WITH_NO_SCREENSHOT); |
| 1512 | + constants.put("reproStepsEnabled", ENABLED); |
| 1513 | + constants.put("reproStepsDisabled", DISABLED); |
| 1514 | + |
1477 | 1515 | constants.put("shakeHint", SHAKE_HINT);
|
1478 | 1516 | constants.put("swipeHint", SWIPE_HINT);
|
1479 | 1517 | constants.put("invalidEmailMessage", INVALID_EMAIL_MESSAGE);
|
|
0 commit comments