From b91ca0a71fa333afa30afd6eab4a3d34466812c8 Mon Sep 17 00:00:00 2001 From: Salma ElTarzi Date: Tue, 16 Jan 2018 18:07:41 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20reproStepsMode=20API=20for=20iOS?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.js | 21 +++++++++++++++++++++ ios/RNInstabug/InstabugReactBridge.m | 8 ++++++++ ios/RNInstabug/RCTConvert+InstabugEnums.m | 7 +++++++ 3 files changed, 36 insertions(+) diff --git a/index.js b/index.js index 2adfb8d..f614f12 100644 --- a/index.js +++ b/index.js @@ -49,6 +49,16 @@ module.exports = { Instabug.dismiss(); }, + /** + * Sets whether user steps tracking is visual, non visula or disabled. + * + * @param {reproStepsMode} reproStepsMode An enum to set user steps tracking to be + * enabled, non visual or disabled. + */ + setReproStepsMode: function (reproStepsMode) { + Instabug.setReproStepsMode(reproStepsMode); + }, + /** * Attaches user data to each report being sent. * Each call to this method overrides the user data to be attached. @@ -863,6 +873,17 @@ module.exports = { floatingButton: Instabug.invocationEventFloatingButton }, + /** + * The user steps option. + * @readonly + * @enum {number} + */ + reproStepsMode: { + enabled: Instabug.reproStepsEnabled, + disabled: Instabug.reproStepsDisabled, + enabledWithNoScreenshot: Instabug.reproStepsEnabledWithNoScreenshot, + }, + /** * Type of SDK dismiss * @readonly diff --git a/ios/RNInstabug/InstabugReactBridge.m b/ios/RNInstabug/InstabugReactBridge.m index bbb0397..8335837 100644 --- a/ios/RNInstabug/InstabugReactBridge.m +++ b/ios/RNInstabug/InstabugReactBridge.m @@ -50,6 +50,10 @@ RCT_EXPORT_METHOD(dismiss) { [Instabug dismiss]; } +RCT_EXPORT_METHOD(setReproStepsMode:(IBGUserStepsMode)reproStepsMode) { + [Instabug setReproStepsMode:reproStepsMode]; +} + RCT_EXPORT_METHOD(setFileAttachment:(NSString *)fileLocation) { [Instabug setFileAttachment:fileLocation]; } @@ -388,6 +392,10 @@ RCT_EXPORT_METHOD(isRunningLive:(RCTResponseSenderBlock)callback) { @"dismissTypeCancel": @(IBGDismissTypeCancel), @"dismissTypeAddAtttachment": @(IBGDismissTypeAddAttachment), + @"reproStepsEnabled": @(IBGUserStepsModeEnable), + @"reproStepsDisabled": @(IBGUserStepsModeEnabledWithNoScreenshots), + @"reproStepsEnabledWithNoScreenshot": @(IBGUserStepsModeDisable), + @"reportTypeBug": @(IBGReportTypeBug), @"reportTypeFeedback": @(IBGReportTypeFeedback), diff --git a/ios/RNInstabug/RCTConvert+InstabugEnums.m b/ios/RNInstabug/RCTConvert+InstabugEnums.m index 294b76e..4980a27 100644 --- a/ios/RNInstabug/RCTConvert+InstabugEnums.m +++ b/ios/RNInstabug/RCTConvert+InstabugEnums.m @@ -34,6 +34,13 @@ RCT_ENUM_CONVERTER(IBGDismissType, (@{ @"dismissTypeAddAtttachment": @(IBGDismissTypeAddAttachment) }), IBGDismissTypeSubmit, integerValue) +RCT_ENUM_CONVERTER(IBGUserStepsMode, (@{ + @"reproStepsEnabled": @(IBGUserStepsModeEnable), + @"reproStepsDisabled": @(IBGUserStepsModeDisable), + @"reproStepsEnabledWithNoScreenshot": @(IBGUserStepsModeEnabledWithNoScreenshots) + }), IBGUserStepsModeEnable, integerValue) + + RCT_ENUM_CONVERTER(IBGReportType, (@{ @"reportTypeBug": @(IBGReportTypeBug), @"reportTypeFeedback": @(IBGReportTypeFeedback)