Skip to content

Commit ba6663d

Browse files
authored
🤝 Merge pull request #2 from Instabug/feature/1.9release
Feature/1.9release
2 parents a147223 + 8725127 commit ba6663d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+258
-199
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@ android {
2121
}
2222

2323
dependencies {
24-
compile 'com.instabug.library:instabug:4.10.2'
24+
compile 'com.instabug.library:instabug:4.11.1'
2525
compile 'com.android.support:multidex:1.0.0'
2626
}

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": "1.8.2",
3+
"version": "1.8.3",
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: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
import com.instabug.library.Feature;
99
import com.instabug.library.Instabug;
10+
import com.instabug.library.extendedbugreport.ExtendedBugReport;
1011
import com.instabug.library.invocation.InstabugInvocationEvent;
1112
import com.instabug.library.invocation.InstabugInvocationMode;
1213
import com.instabug.library.invocation.util.InstabugVideoRecordingButtonCorner;
@@ -169,7 +170,10 @@ public boolean execute(final String action, JSONArray args, final CallbackContex
169170
} else if ("setAutoScreenRecordingMaxDuration".equals(action)) {
170171
setAutoScreenRecordingMaxDuration(callbackContext, args.optInt(0));
171172

172-
} else {
173+
} else if ("setExtendedBugReportMode".equals(action)) {
174+
setExtendedBugReportMode(callbackContext, args.optString(0));
175+
176+
}else {
173177
// Method not found.
174178
return false;
175179
}
@@ -244,7 +248,7 @@ private void showIntroDialog(final CallbackContext callbackContext) {
244248
*
245249
* @param callbackContext
246250
* Used when calling back into JavaScript
247-
* @param colorInt
251+
* @param colorString
248252
* The value of the primary color
249253
*/
250254
private void setPrimaryColor(final CallbackContext callbackContext, String colorString) {
@@ -706,6 +710,30 @@ private void setVideoRecordingFloatingButtonPosition(final CallbackContext callb
706710
}
707711
}
708712

713+
/**
714+
* Sets whether the extended bug report mode should be disabled, enabled with
715+
* required fields or enabled with optional fields.
716+
*
717+
* @param callbackContext
718+
* Used when calling back into JavaScript
719+
* @param mode
720+
* A string to disable the extended bug report mode, enable it with
721+
* required or with optional fields
722+
*/
723+
private void setExtendedBugReportMode(final CallbackContext callbackContext, String mode) {
724+
try {
725+
if(mode.equals("enabledWithRequiredFields")) {
726+
Instabug.setExtendedBugReportState(ExtendedBugReport.State.ENABLED_WITH_REQUIRED_FIELDS);
727+
} else if(mode.equals("enabledWithOptionalFields")) {
728+
Instabug.setExtendedBugReportState(ExtendedBugReport.State.ENABLED_WITH_OPTIONAL_FIELDS);
729+
} else if(mode.equals("disabled")) {
730+
Instabug.setExtendedBugReportState(ExtendedBugReport.State.DISABLED);
731+
}
732+
} catch (IllegalStateException e) {
733+
callbackContext.error(errorMsg);
734+
}
735+
}
736+
709737
/**
710738
* Adds intent extras for all options passed to activate().
711739
*/

src/ios/IBGPlugin.m

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,6 +417,31 @@ - (void) setReproStepsMode:(CDVInvokedUrlCommand*)command
417417
[self.commandDelegate sendPluginResult:result callbackId:[command callbackId]];
418418
}
419419

420+
421+
/**
422+
* Sets whether the extended bug report mode should be disabled, enabled with
423+
* required fields or enabled with optional fields.
424+
*
425+
* @param {CDVInvokedUrlCommand*} command
426+
* The command sent from JavaScript
427+
*/
428+
- (void) setExtendedBugReportMode:(CDVInvokedUrlCommand*)command
429+
{
430+
CDVPluginResult* result;
431+
432+
IBGExtendedBugReportMode extendedBugReportMode = [self parseExtendedBugReportMode:[command argumentAtIndex:0]];
433+
434+
if (extendedBugReportMode != -1) {
435+
[Instabug setExtendedBugReportMode:extendedBugReportMode];
436+
result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK];
437+
} else {
438+
result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR
439+
messageAsString:@"A valid extended bug report mode must be provided."];
440+
}
441+
442+
[self.commandDelegate sendPluginResult:result callbackId:[command callbackId]];
443+
}
444+
420445
/**
421446
* Convenience method for setting whether the email
422447
* field is validated or not.
@@ -737,6 +762,24 @@ - (IBGUserStepsMode) parseReproStepsMode:(NSString*)mode
737762
} else return 0;
738763
}
739764

765+
/**
766+
* Convenience method for converting NSString to
767+
* IBGExtendedBugReportMode.
768+
*
769+
* @param {NSString*} mode
770+
* NSString shortcode for IBGExtendedBugReportMode
771+
*/
772+
- (IBGExtendedBugReportMode) parseExtendedBugReportMode:(NSString*)mode
773+
{
774+
if ([mode isEqualToString:@"enabledWithRequiredFields"]) {
775+
return IBGExtendedBugReportModeEnabledWithRequiredFields;
776+
} else if ([mode isEqualToString:@"enabledWithOptionalFields"]) {
777+
return IBGExtendedBugReportModeEnabledWithOptionalFields;
778+
} else if ([mode isEqualToString:@"disabled"]) {
779+
return IBGExtendedBugReportModeDisabled;
780+
} else return -1;
781+
}
782+
740783
/**
741784
* Convenience method for converting NSString to
742785
* IBGLocale.

src/ios/Instabug.framework/Headers/Instabug.h

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
66
Copyright: (c) 2013-2018 by Instabug, Inc., all rights reserved.
77
8-
Version: 7.9.2
8+
Version: 7.10
99
*/
1010

1111
#import <Foundation/Foundation.h>
@@ -697,7 +697,7 @@ typedef void (^NetworkObfuscationCompletionBlock)(NSData *data, NSURLResponse *r
697697
@param names Array of names of icons to be shown along with titles. Use the same names you would use
698698
with `+ [UIImage imageNamed:]`.
699699
*/
700-
+ (void)setReportCategoriesWithTitles:(NSArray<NSString *> *)titles iconNames:(nullable NSArray<NSString *> *)names;
700+
+ (void)setReportCategoriesWithTitles:(NSArray<NSString *> *)titles iconNames:(nullable NSArray<NSString *> *)names DEPRECATED_MSG_ATTRIBUTE("Starting from v7.9, you can add categories from dashboard.");
701701

702702
/**
703703
@brief Sets an array of report categories to be shown for users to select from before reporting a bug or sending
@@ -708,14 +708,26 @@ typedef void (^NetworkObfuscationCompletionBlock)(NSData *data, NSURLResponse *r
708708
@param title extra field key.
709709
@param required determine whether this field is required or not.
710710
*/
711-
+ (void)addExtraReportFieldWithTitle:(NSString *)title required:(BOOL)required;
711+
+ (void)addExtraReportFieldWithTitle:(NSString *)title required:(BOOL)required DEPRECATED_MSG_ATTRIBUTE("Starting from v7.9, use setExtendedBugReportMode: instead");;
712712

713713
/**
714714
@brief Remove all extra fields.
715715
716716
@discussion Use this method to remove all added extra fields.
717717
*/
718-
+ (void)removeExtraReportFields;
718+
+ (void)removeExtraReportFields DEPRECATED_MSG_ATTRIBUTE("Starting from v7.9, use setExtendedBugReportMode: instead");;
719+
720+
/**
721+
@brief Sets whether the extended bug report mode should be disabled, enabled with required fields or enabled with optional fields.
722+
723+
@discussion This feature is disabled by default. When enabled, it adds more fields for your reporters to fill in. You can set whether the extra fields are required or optional.
724+
1. Expected Results.
725+
2. Actual Results.
726+
3. Steps to Reproduce.
727+
728+
@param extendedBugReportMode An enum to disable the extended bug report mode, enable it with required or with optional fields.
729+
*/
730+
+ (void)setExtendedBugReportMode:(IBGExtendedBugReportMode)extendedBugReportMode;
719731

720732
/**
721733
@brief Set custom user attributes that are going to be sent with each feedback, bug or crash.

src/ios/Instabug.framework/Info.plist

-1 Bytes
Binary file not shown.

src/ios/Instabug.framework/Instabug

476 KB
Binary file not shown.

src/ios/Instabug.framework/_CodeSignature/CodeResources

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66
<dict>
77
<key>Headers/Instabug.h</key>
88
<data>
9-
4kxZEeE00REbmUfGg94C3NULVvw=
9+
EW0LawU2ocbTJXyXab6eGuYBqIg=
1010
</data>
1111
<key>Info.plist</key>
1212
<data>
13-
VKe9NgIDfUhBqsBVFqPK7wnZNKg=
13+
uPr3dFdFtDxfIr/Z4Ak4dMZUtXU=
1414
</data>
1515
<key>Modules/module.modulemap</key>
1616
<data>
@@ -23,11 +23,11 @@
2323
<dict>
2424
<key>hash</key>
2525
<data>
26-
4kxZEeE00REbmUfGg94C3NULVvw=
26+
EW0LawU2ocbTJXyXab6eGuYBqIg=
2727
</data>
2828
<key>hash2</key>
2929
<data>
30-
jm2cECRm9S/pqpKmkItxvSLqsykctBM5sYtNF2GHj0o=
30+
1QgezJN+NvpRWcOOsFWXKUZJT723WvQT5vRR6J+lA/Y=
3131
</data>
3232
</dict>
3333
<key>Modules/module.modulemap</key>

src/ios/InstabugCore.framework/Headers/IBGTypes.h

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
66
Copyright: (c) 2013-2018 by Instabug, Inc., all rights reserved.
77
8-
Version: 7.9.2
8+
Version: 7.10
99
*/
1010

1111
#import <UIKit/UIKit.h>
@@ -78,6 +78,10 @@ extern NSString * const kIBGSurveyThankYouTitleText;
7878
extern NSString * const kIBGSurveyThankYouDescriptionText;
7979
extern NSString * const kIBGSurveysNPSLeastLikelyStringName;
8080
extern NSString * const kIBGSurveysNPSMostLikelyStringName;
81+
extern NSString * const kIBGExpectedResultsStringName;
82+
extern NSString * const kIBGActualResultsStringName;
83+
extern NSString * const kIBGStepsToReproduceStringName;
84+
extern NSString * const kIBGReplyButtonTitleStringName;
8185

8286
/// -----------
8387
/// @name Enums
@@ -262,7 +266,11 @@ typedef NS_ENUM(NSInteger, IBGString) {
262266
IBGStringSurveyIntroTakeSurveyButtonText,
263267
IBGStringSurveyIntroDismissButtonText,
264268
IBGStringSurveyThankYouTitleText,
265-
IBGStringSurveyThankYouDescriptionText
269+
IBGStringSurveyThankYouDescriptionText,
270+
IBGExpectedResultsStringName,
271+
IBGActualResultsStringName,
272+
IBGStepsToReproduceStringName,
273+
IBGReplyButtonTitleStringName
266274
};
267275

268276
/**
@@ -315,6 +323,15 @@ typedef NS_OPTIONS(NSInteger, IBGAttachmentType) {
315323
IBGAttachmentTypeScreenRecording = 1 << 6,
316324
};
317325

326+
/**
327+
The extended bug report mode.
328+
*/
329+
typedef NS_ENUM(NSInteger, IBGExtendedBugReportMode) {
330+
IBGExtendedBugReportModeEnabledWithRequiredFields,
331+
IBGExtendedBugReportModeEnabledWithOptionalFields,
332+
IBGExtendedBugReportModeDisabled
333+
};
334+
318335
@interface UIView (Instabug)
319336

320337
/**

src/ios/InstabugCore.framework/Headers/InstabugCore.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
66
Copyright: (c) 2013-2018 by Instabug, Inc., all rights reserved.
77
8-
Version: 7.9.2
8+
Version: 7.10
99
*/
1010

1111
#import <Foundation/Foundation.h>
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
-65 Bytes
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
3 Bytes
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
-1 Bytes
Binary file not shown.
98 KB
Binary file not shown.

0 commit comments

Comments
 (0)