Skip to content

Commit cdd7bf8

Browse files
committed
feat: deprecate setReproStepsMode
1 parent 77e132c commit cdd7bf8

File tree

2 files changed

+54
-19
lines changed

2 files changed

+54
-19
lines changed

src/ios/IBGPlugin.m

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -731,7 +731,7 @@ - (void) setLocale:(CDVInvokedUrlCommand*)command
731731
* @param {CDVInvokedUrlCommand*} command
732732
* The command sent from JavaScript
733733
*/
734-
- (void) setReproStepsMode:(CDVInvokedUrlCommand*)command
734+
- (void) setReproStepsMode:(CDVInvokedUrlCommand*)command DEPRECATED_MSG_ATTRIBUTE("This method is deprecated and will be removed in a future version. Use 'setReproStepsConfig:' instead.");
735735
{
736736
NSString* mode = [command argumentAtIndex:0];
737737
IBGUserStepsMode parsedMode = (IBGUserStepsMode) [ArgsRegistry.reproStepsModes[mode] intValue];
@@ -740,7 +740,18 @@ - (void) setReproStepsMode:(CDVInvokedUrlCommand*)command
740740
[self.commandDelegate sendPluginResult:[CDVPluginResult resultWithStatus:CDVCommandStatus_OK]
741741
callbackId:[command callbackId]];
742742
}
743-
743+
- (void)setReproStepsConfig:(CDVInvokedUrlCommand*)command {
744+
NSArray* arguments = [command arguments];
745+
IBGUserStepsMode bugMode = (IBGUserStepsMode)[arguments[0] intValue];
746+
IBGUserStepsMode crashMode = (IBGUserStepsMode)[arguments[1] intValue];
747+
IBGUserStepsMode sessionReplayMode = (IBGUserStepsMode)[arguments[2] intValue];
748+
[Instabug setReproStepsFor:IBGIssueTypeBug withMode:bugMode];
749+
[Instabug setReproStepsFor:IBGIssueTypeCrash withMode:crashMode];
750+
[Instabug setReproStepsFor:IBGIssueTypeSessionReplay withMode:sessionReplayMode];
751+
752+
CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK];
753+
[self.commandDelegate sendPluginResult:pluginResult callbackId:[command callbackId]];
754+
}
744755
/**
745756
* Sets the welcome message mode.
746757
*

src/modules/Instabug.ts

Lines changed: 41 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -76,23 +76,47 @@ namespace Instabug {
7676
exec("IBGPlugin", "logUserEventWithName", [userEvent], success, error);
7777
};
7878

79-
/**
80-
* Sets whether user steps tracking is visual, non visual or disabled.
81-
* User Steps tracking is enabled by default if it's available
82-
* in your current plan.
83-
*
84-
* @param reproStepsMode an enum to set user steps tracking
85-
* to be enabled, non visual or disabled.
86-
* @param success callback on function success.
87-
* @param error callback on function error.
88-
*/
89-
export const setReproStepsMode = (
90-
reproStepsMode: registry.reproStepsMode | `${registry.reproStepsMode}`,
91-
success?: () => void,
92-
error?: (err: any) => void
93-
) => {
94-
exec("IBGPlugin", "setReproStepsMode", [reproStepsMode], success, error);
95-
};
79+
/**
80+
* Sets whether user steps tracking is visual, non visual or disabled.
81+
* User Steps tracking is enabled by default if it's available
82+
* in your current plan.
83+
*
84+
* @deprecated This method is deprecated and will be removed in a future version.
85+
* Use `setReproStepsConfig` instead.
86+
*
87+
* @param reproStepsMode an enum to set user steps tracking
88+
* to be enabled, non visual or disabled.
89+
* @param success callback on function success.
90+
* @param error callback on function error.
91+
*/
92+
export const setReproStepsMode = (
93+
reproStepsMode: registry.reproStepsMode | `${registry.reproStepsMode}`,
94+
success?: () => void,
95+
error?: (err: any) => void
96+
) => {
97+
exec("IBGPlugin", "setReproStepsMode", [reproStepsMode], success, error);
98+
};
99+
100+
/**
101+
* Configures user steps tracking for bug, crash, and session replay issue types separately.
102+
* User Steps tracking is enabled by default if it's available
103+
* in your current plan.
104+
*
105+
* @param bugMode an enum to set user steps tracking for bug issues.
106+
* @param crashMode an enum to set user steps tracking for crash issues.
107+
* @param sessionReplayMode an enum to set user steps tracking for session replay issues.
108+
* @param success callback on function success.
109+
* @param error callback on function error.
110+
*/
111+
export const setReproStepsConfig = (
112+
bugMode: registry.reproStepsMode | `${registry.reproStepsMode}`,
113+
crashMode: registry.reproStepsMode | `${registry.reproStepsMode}`,
114+
sessionReplayMode: registry.reproStepsMode | `${registry.reproStepsMode}`,
115+
success?: () => void,
116+
error?: (err: any) => void
117+
) => {
118+
exec("IBGPlugin", "setReproStepsConfig", [bugMode, crashMode, sessionReplayMode], success, error);
119+
};
96120

97121
/**
98122
* The session profiler is enabled by default and it attaches to the bug and

0 commit comments

Comments
 (0)