Skip to content

Commit fbed1b7

Browse files
committed
✨ setShouldShowSurveysWelcomeScreen API
1 parent 96854fe commit fbed1b7

File tree

3 files changed

+31
-1
lines changed

3 files changed

+31
-1
lines changed

android/src/main/java/com/instabug/reactlibrary/RNInstabugReactnativeModule.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1472,6 +1472,21 @@ public void setSessionProfilerEnabled(boolean sessionProfilerEnabled) {
14721472
}
14731473
}
14741474

1475+
/**
1476+
* Set Surveys welcome screen enabled, default value is false
1477+
*
1478+
* @param shouldShow shouldShow whether should a welcome screen be shown
1479+
* before taking surveys or not
1480+
*/
1481+
@ReactMethod
1482+
public void setShouldShowSurveysWelcomeScreen(boolean shouldShow) {
1483+
try {
1484+
InstabugSurvey.setShouldShowSurveysWelcomeScreen(shouldShow);
1485+
} catch (java.lang.Exception exception) {
1486+
exception.printStackTrace();
1487+
}
1488+
}
1489+
14751490
private InstabugCustomTextPlaceHolder.Key getStringToKeyConstant(String key) {
14761491
switch (key) {
14771492
case SHAKE_HINT:

index.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -928,7 +928,7 @@ module.exports = {
928928
} else {
929929
Instabug.sendHandledJSCrash(jsonObject);
930930
}
931-
},
931+
},
932932

933933
/**
934934
* Sets the default position at which the Instabug screen recording button will be shown.
@@ -972,6 +972,17 @@ module.exports = {
972972
Instabug.showFeatureRequests();
973973
},
974974

975+
/**
976+
* Setting an option for all the surveys to show a welcome screen before
977+
* the user starts taking the survey.
978+
* @param shouldShowWelcomeScreen A boolean for setting whether the
979+
* welcome screen should show.
980+
*
981+
*/
982+
setShouldShowSurveysWelcomeScreen: function(shouldShowWelcomeScreen) {
983+
Instabug.setShouldShowSurveysWelcomeScreen(shouldShowWelcomeScreen);
984+
},
985+
975986
/**
976987
* The event used to invoke the feedback form
977988
* @readonly

ios/RNInstabug/InstabugReactBridge.m

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,10 @@ - (dispatch_queue_t)methodQueue {
410410
[Instabug showFeatureRequests];
411411
}
412412

413+
RCT_EXPORT_METHOD(setShouldShowSurveysWelcomeScreen:(BOOL)shouldShowWelcomeScreen) {
414+
[Instabug setShouldShowSurveysWelcomeScreen:shouldShowWelcomeScreen];
415+
}
416+
413417
RCT_EXPORT_METHOD(isRunningLive:(RCTResponseSenderBlock)callback) {
414418
BOOL result = NO;
415419
#if TARGET_OS_SIMULATOR

0 commit comments

Comments
 (0)