Skip to content

Commit 08e28a8

Browse files
committed
✨ setExtendedBugReportMode API for iOS
1 parent 55e5dd8 commit 08e28a8

File tree

3 files changed

+38
-0
lines changed

3 files changed

+38
-0
lines changed

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/RNInstabug/InstabugReactBridge.m

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,10 @@ - (dispatch_queue_t)methodQueue {
168168
[Instabug setLocale:locale];
169169
}
170170

171+
RCT_EXPORT_METHOD(setExtendedBugReportMode:(IBGExtendedBugReportMode)extendedBugReportMode) {
172+
[Instabug setExtendedBugReportMode:extendedBugReportMode];
173+
}
174+
171175
RCT_EXPORT_METHOD(setIntroMessageEnabled:(BOOL)isIntroMessageEnabled) {
172176
[Instabug setIntroMessageEnabled:isIntroMessageEnabled];
173177
}
@@ -438,6 +442,10 @@ - (NSDictionary *)constantsToExport
438442
@"colorThemeLight": @(IBGColorThemeLight),
439443
@"colorThemeDark": @(IBGColorThemeDark),
440444

445+
@"enabledWithRequiredFields": @(IBGExtendedBugReportModeEnabledWithRequiredFields),
446+
@"enabledWithOptionalFields": @(IBGExtendedBugReportModeEnabledWithOptionalFields),
447+
@"disabled": @(IBGExtendedBugReportModeDisabled),
448+
441449
@"shakeHint": @(IBGStringShakeHint),
442450
@"swipeHint": @(IBGStringSwipeHint),
443451
@"edgeSwipeStartHint": @(IBGStringEdgeSwipeStartHint),

ios/RNInstabug/RCTConvert+InstabugEnums.m

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,12 @@ @implementation RCTConvert (InstabugEnums)
4040
@"reproStepsEnabledWithNoScreenshot": @(IBGUserStepsModeEnabledWithNoScreenshots)
4141
}), IBGUserStepsModeEnable, integerValue)
4242

43+
RCT_ENUM_CONVERTER(IBGExtendedBugReportMode, (@{
44+
@"enabledWithRequiredFields": @(IBGExtendedBugReportModeEnabledWithRequiredFields),
45+
@"enabledWithOptionalFields": @(IBGExtendedBugReportModeEnabledWithOptionalFields),
46+
@"disabled": @(IBGExtendedBugReportModeDisabled)
47+
}), IBGExtendedBugReportModeDisabled, integerValue)
48+
4349

4450
RCT_ENUM_CONVERTER(IBGReportType, (@{
4551
@"reportTypeBug": @(IBGReportTypeBug),

0 commit comments

Comments
 (0)