Skip to content

Commit 3066991

Browse files
committed
💎 Bump version to 8.0.1
2 parents dc93ca9 + 5ad5e70 commit 3066991

File tree

4 files changed

+41
-5
lines changed

4 files changed

+41
-5
lines changed

‎package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "instabug-cordova",
3-
"version": "8.0.0",
3+
"version": "8.0.1",
44
"description": "The purpose of this plugin is to simplify the process of integrating the Instabug SDK in a hybrid application, as well as to provide an interface to interfacing with the SDK through JavaScript.",
55
"main": "index.js",
66
"repository": {

‎src/android/IBGPlugin.java

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,8 @@ public boolean execute(final String action, JSONArray args, final CallbackContex
242242
setEmailFieldRequiredForFeatureRequests(callbackContext, args.optBoolean(0), args.optJSONArray(1));
243243
} else if ("showWelcomeMessage".equals(action)) {
244244
showWelcomeMessage(callbackContext, args.optString(0));
245-
245+
} else if ("setCommentFieldRequired".equals(action)) {
246+
setCommentFieldRequired(callbackContext, args.optBoolean(0));
246247
} else {
247248
// Method not found.
248249
return false;
@@ -266,6 +267,16 @@ private void activate(final CallbackContext callbackContext, JSONArray args) {
266267
callbackContext.success();
267268
}
268269

270+
/**
271+
* @deprecated since version 8.0.0.
272+
* @param callbackContext
273+
* @param required
274+
*/
275+
public void setCommentFieldRequired(final CallbackContext callbackContext, boolean required) {
276+
Instabug.setCommentFieldRequired(required);
277+
callbackContext.success();
278+
}
279+
269280
/**
270281
* Sets the invocation options used when invoke Instabug SDK
271282
*

‎src/ios/IBGPlugin.m

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -811,6 +811,23 @@ - (void) setExtendedBugReportMode:(CDVInvokedUrlCommand*)command
811811
[self.commandDelegate sendPluginResult:result callbackId:[command callbackId]];
812812
}
813813

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+
814831
/**
815832
* Convenience method for setting whether the email
816833
* field is validated or not.
@@ -832,13 +849,14 @@ - (void) setEmailFieldRequired:(NSString*)required
832849
* @param {NSString*} required
833850
* NSString representation of boolean required
834851
*/
835-
- (void) setCommentFieldRequired:(NSString*)required
852+
- (void) setCommentRequired:(NSString*)required
836853
{
837854
if ([required length] > 0) {
838-
[Instabug setCommentFieldRequired:[required boolValue]];
855+
[Instabug setCommentFieldRequired:true];
839856
}
840857
}
841858

859+
842860
/**
843861
* Convenience method for setting the default SDK
844862
* mode upon invocation.
@@ -1299,7 +1317,7 @@ - (void) setShouldShowSurveysWelcomeScreen:(CDVInvokedUrlCommand*)command
12991317
- (void) applyOptions:(NSDictionary*)options
13001318
{
13011319
[self setEmailFieldRequired:[[options objectForKey:@"emailRequired"] stringValue]];
1302-
[self setCommentFieldRequired:[[options objectForKey:@"commentRequired"] stringValue]];
1320+
[self setCommentRequired:[[options objectForKey:@"commentRequired"] stringValue]];
13031321
[self setDefaultInvocationMode:[options objectForKey:@"defaultInvocationMode"]];
13041322
[self setShakingThresholdForIPhone:[options objectForKey:@"shakingThresholdIPhone"]
13051323
forIPad:[options objectForKey:@"shakingThresholdIPad"]];

‎www/instabug.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -492,4 +492,11 @@ Instabug.setShouldShowSurveysWelcomeScreen = function (shouldShowWelcomeScreen,
492492
exec(success, error, 'IBGPlugin', 'setShouldShowSurveysWelcomeScreen', [shouldShowWelcomeScreen]);
493493
};
494494

495+
/**
496+
* @deprecated since version 8.0.0.
497+
*/
498+
Instabug.setCommentFieldRequired = function(commentRequired, success, error) {
499+
exec(success, error, 'IBGPlugin', 'setCommentFieldRequired', [commentRequired])
500+
}
501+
495502
module.exports = Instabug;

0 commit comments

Comments
 (0)