Skip to content

Commit 249ab75

Browse files
authored
🤝 Merge pull request #2 from Instabug/feature/2.7_new_apis
Feature/2.7 new apis
2 parents 2380c72 + 72c666c commit 249ab75

File tree

58 files changed

+243
-197
lines changed

Some content is hidden

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

58 files changed

+243
-197
lines changed

android/build.gradle

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

2222
dependencies {
2323
compile 'com.facebook.react:react-native:0.20.+'
24-
compile ('com.instabug.library:instabug:4.10.2'){
24+
compile ('com.instabug.library:instabug:4.11.1'){
2525
exclude group: 'com.android.support'
2626
}
2727

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

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import com.facebook.react.modules.core.DeviceEventManagerModule;
2222
import com.instabug.library.Feature;
2323
import com.instabug.library.Instabug;
24+
import com.instabug.library.extendedbugreport.ExtendedBugReport;
2425
import com.instabug.library.internal.module.InstabugLocale;
2526
import com.instabug.library.invocation.InstabugInvocationEvent;
2627
import com.instabug.library.invocation.InstabugInvocationMode;
@@ -87,6 +88,11 @@ public class RNInstabugReactnativeModule extends ReactContextBaseJavaModule {
8788
private final String BOTTOM_RIGHT = "bottomRight";
8889
private final String BOTTOM_LEFT = "bottomLeft";
8990

91+
//Instabug extended bug report modes
92+
private final String EXTENDED_BUG_REPORT_REQUIRED_FIELDS = "enabledWithRequiredFields";
93+
private final String EXTENDED_BUG_REPORT_OPTIONAL_FIELDS = "enabledWithOptionalFields";
94+
private final String EXTENDED_BUG_REPORT_DISABLED = "disabled";
95+
9096
//Theme colors
9197
private final String COLOR_THEME_LIGHT = "light";
9298
private final String COLOR_THEME_DARK = "dark";
@@ -205,6 +211,8 @@ public void invokeWithInvocationMode(String invocationMode) {
205211
}
206212

207213

214+
215+
208216
/**
209217
* Dismisses all visible Instabug views
210218
*/
@@ -279,6 +287,33 @@ public void changeLocale(String instabugLocale) {
279287
}
280288
}
281289

290+
/**
291+
* Sets whether the extended bug report mode should be disabled,
292+
* enabled with required fields, or enabled with optional fields.
293+
*
294+
* @param extendedBugReportMode
295+
*/
296+
@ReactMethod
297+
public void setExtendedBugReportMode(String extendedBugReportMode) {
298+
try {
299+
switch(extendedBugReportMode) {
300+
case EXTENDED_BUG_REPORT_REQUIRED_FIELDS:
301+
Instabug.setExtendedBugReportState(ExtendedBugReport.State.ENABLED_WITH_REQUIRED_FIELDS);
302+
break;
303+
case EXTENDED_BUG_REPORT_OPTIONAL_FIELDS:
304+
Instabug.setExtendedBugReportState(ExtendedBugReport.State.ENABLED_WITH_OPTIONAL_FIELDS);
305+
break;
306+
case EXTENDED_BUG_REPORT_DISABLED:
307+
Instabug.setExtendedBugReportState(ExtendedBugReport.State.DISABLED);
308+
break;
309+
default:
310+
Instabug.setExtendedBugReportState(ExtendedBugReport.State.DISABLED);
311+
}
312+
} catch (Exception e) {
313+
e.printStackTrace();
314+
}
315+
}
316+
282317
@ReactMethod
283318
public void setViewHierarchyEnabled(boolean enabled) {
284319
try {
@@ -1435,6 +1470,10 @@ public Map<String, Object> getConstants() {
14351470
constants.put("bottomRight", BOTTOM_RIGHT);
14361471
constants.put("bottomLeft", BOTTOM_LEFT);
14371472

1473+
constants.put("enabledWithRequiredFields", EXTENDED_BUG_REPORT_REQUIRED_FIELDS);
1474+
constants.put("enabledWithOptionalFields", EXTENDED_BUG_REPORT_OPTIONAL_FIELDS);
1475+
constants.put("disabled", EXTENDED_BUG_REPORT_DISABLED);
1476+
14381477
constants.put("shakeHint", SHAKE_HINT);
14391478
constants.put("swipeHint", SWIPE_HINT);
14401479
constants.put("invalidEmailMessage", INVALID_EMAIL_MESSAGE);

index.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -515,6 +515,7 @@ module.exports = {
515515
},
516516

517517
/**
518+
* @deprecated since version 2.7.0, you can now add categories from the dashboard.
518519
* Sets an array of report categories to be shown for users to select from before reporting a
519520
* bug or sending feedback.
520521
* Use this method to give users a list of choices of categories their bug report or feedback
@@ -529,6 +530,17 @@ module.exports = {
529530
}
530531
},
531532

533+
/**
534+
* ets whether the extended bug report mode should be disabled, enabled with
535+
* required fields or enabled with optional fields.
536+
* @param {extendedBugReportMode} extendedBugReportMode An enum to disable
537+
* the extended bug report mode, enable it
538+
* with required or with optional fields.
539+
*/
540+
setExtendedBugReportMode: function (extendedBugReportMode) {
541+
Instabug.setExtendedBugReportMode(extendedBugReportMode);
542+
},
543+
532544
/**
533545
* Logs a user event that happens through the lifecycle of the application.
534546
* Logged user events are going to be sent with each report, as well as at the end of a session.
@@ -935,6 +947,18 @@ module.exports = {
935947
chatsList: Instabug.invocationModeChatsList
936948
},
937949

950+
/**
951+
* The extended bug report mode
952+
* @readonly
953+
* @enum {number}
954+
*/
955+
extendedBugReportMode: {
956+
enabledWithRequiredFields: Instabug.enabledWithRequiredFields,
957+
enabledWithOptionalFields: Instabug.enabledWithOptionalFields,
958+
disabled: Instabug.disabled
959+
},
960+
961+
938962
/**
939963
* The supported locales
940964
* @readonly

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.

ios/Instabug.framework/Info.plist

-1 Bytes
Binary file not shown.

ios/Instabug.framework/Instabug

476 KB
Binary file not shown.

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>

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
/**

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.
-6 Bytes
Binary file not shown.
-65 Bytes
Binary file not shown.
Binary file not shown.
3 Bytes
Binary file not shown.
Binary file not shown.
0 Bytes
Binary file not shown.
4 Bytes
Binary file not shown.
3 Bytes
Binary file not shown.
-7 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.

ios/InstabugCore.framework/Info.plist

-1 Bytes
Binary file not shown.
98 KB
Binary file not shown.

0 commit comments

Comments
 (0)