@@ -811,6 +811,23 @@ - (void) setExtendedBugReportMode:(CDVInvokedUrlCommand*)command
811
811
[self .commandDelegate sendPluginResult: result callbackId: [command callbackId ]];
812
812
}
813
813
814
+ -(void ) setCommentFieldRequired : (CDVInvokedUrlCommand*)command
815
+ {
816
+ CDVPluginResult* result;
817
+
818
+ BOOL isRequired = [command argumentAtIndex: 0 ];
819
+
820
+ if (isRequired) {
821
+ [Instabug setCommentFieldRequired: [[command argumentAtIndex: 0 ] boolValue ]];
822
+ result = [CDVPluginResult resultWithStatus: CDVCommandStatus_OK];
823
+ } else {
824
+ result = [CDVPluginResult resultWithStatus: CDVCommandStatus_ERROR
825
+ messageAsString: @" A boolean value must be provided." ];
826
+ }
827
+
828
+ [self .commandDelegate sendPluginResult: result callbackId: [command callbackId ]];
829
+ }
830
+
814
831
/* *
815
832
* Convenience method for setting whether the email
816
833
* field is validated or not.
@@ -832,13 +849,14 @@ - (void) setEmailFieldRequired:(NSString*)required
832
849
* @param {NSString*} required
833
850
* NSString representation of boolean required
834
851
*/
835
- - (void ) setCommentFieldRequired : (NSString *)required
852
+ - (void ) setCommentRequired : (NSString *)required
836
853
{
837
854
if ([required length ] > 0 ) {
838
- [Instabug setCommentFieldRequired: [required boolValue ] ];
855
+ [Instabug setCommentFieldRequired: true ];
839
856
}
840
857
}
841
858
859
+
842
860
/* *
843
861
* Convenience method for setting the default SDK
844
862
* mode upon invocation.
@@ -1299,7 +1317,7 @@ - (void) setShouldShowSurveysWelcomeScreen:(CDVInvokedUrlCommand*)command
1299
1317
- (void ) applyOptions : (NSDictionary *)options
1300
1318
{
1301
1319
[self setEmailFieldRequired: [[options objectForKey: @" emailRequired" ] stringValue ]];
1302
- [self setCommentFieldRequired : [[options objectForKey: @" commentRequired" ] stringValue ]];
1320
+ [self setCommentRequired : [[options objectForKey: @" commentRequired" ] stringValue ]];
1303
1321
[self setDefaultInvocationMode: [options objectForKey: @" defaultInvocationMode" ]];
1304
1322
[self setShakingThresholdForIPhone: [options objectForKey: @" shakingThresholdIPhone" ]
1305
1323
forIPad: [options objectForKey: @" shakingThresholdIPad" ]];
0 commit comments