@@ -670,7 +670,7 @@ - (void) setThresholdForReshowingSurveyAfterDismiss:(CDVInvokedUrlCommand*)comma
670670 NSInteger sessionsCount = [[command argumentAtIndex: 0 ] integerValue ];
671671 NSInteger daysCount = [[command argumentAtIndex: 1 ] integerValue ];
672672
673- if (sessionsCount && daysCount ) {
673+ if (sessionsCount && daysCount) {
674674 [Instabug setThresholdForReshowingSurveyAfterDismiss: sessionsCount daysCount: daysCount];
675675 result = [CDVPluginResult resultWithStatus: CDVCommandStatus_OK];
676676 } else {
@@ -681,6 +681,30 @@ - (void) setThresholdForReshowingSurveyAfterDismiss:(CDVInvokedUrlCommand*)comma
681681 [self .commandDelegate sendPluginResult: result callbackId: [command callbackId ]];
682682 }
683683
684+ /* *
685+ * Sets a threshold for numbers of sessions and another for number of days
686+ * required before a survey, that has been dismissed once, would show again.
687+ *
688+ * @param {CDVInvokedUrlCommand*} command
689+ * The command sent from JavaScript
690+ */
691+ - (void ) setAutoShowingSurveysEnabled:(CDVInvokedUrlCommand*)command
692+ {
693+ CDVPluginResult* result;
694+
695+ BOOL autoShowingSurveysEnabled = [command argumentAtIndex: 0 ];
696+
697+ if (autoShowingSurveysEnabled) {
698+ [Instabug setAutoShowingSurveysEnabled: autoShowingSurveysEnabled];
699+ result = [CDVPluginResult resultWithStatus: CDVCommandStatus_OK];
700+ } else {
701+ result = [CDVPluginResult resultWithStatus: CDVCommandStatus_ERROR
702+ messageAsString: @" A boolean value must be provided." ];
703+ }
704+
705+ [self .commandDelegate sendPluginResult: result callbackId: [command callbackId ]];
706+ }
707+
684708/* *
685709 * Wrapper method for applying all provided options.
686710 *
0 commit comments