Skip to content

Commit eb03bca

Browse files
committed
chore: remove deperecated APIs
1 parent 5c8f2cf commit eb03bca

File tree

15 files changed

+11
-314
lines changed

15 files changed

+11
-314
lines changed

examples/default/src/navigation/HomeStack.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ import {
2222
import { GoogleMapsScreen } from '../screens/user-steps/GoogleMapsScreen';
2323
import { LargeImageListScreen } from '../screens/user-steps/LargeImageListScreen';
2424
import { APMScreen } from '../screens/apm/APMScreen';
25-
import { TracesScreen } from '../screens/apm/TracesScreen';
2625
import { NetworkScreen } from '../screens/apm/NetworkScreen';
2726
import { FlowsScreen } from '../screens/apm/FlowsScreen';
2827
import { SessionReplayScreen } from '../screens/SessionReplayScreen';
@@ -140,7 +139,6 @@ export const HomeStackNavigator: React.FC = () => {
140139
<HomeStack.Screen name="Gestures" component={GesturesScreen} />
141140
<HomeStack.Screen name="APM" component={APMScreen} />
142141
<HomeStack.Screen name="NetworkTraces" component={NetworkScreen} />
143-
<HomeStack.Screen name="ExecutionTraces" component={TracesScreen} />
144142
<HomeStack.Screen name="AppFlows" component={FlowsScreen} />
145143
<HomeStack.Screen
146144
name="LegacyMode"

examples/default/src/screens/apm/APMScreen.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ export const APMScreen: React.FC<NativeStackScreenProps<HomeStackParamList, 'APM
3434
{CustomGap.smallV}
3535
<ListTile title="End App launch" onPress={() => APM.endAppLaunch()} />
3636
<ListTile title="Network Screen" onPress={() => navigation.navigate('NetworkTraces')} />
37-
<ListTile title="Traces" onPress={() => navigation.navigate('ExecutionTraces')} />
3837
<ListTile title="Flows" onPress={() => navigation.navigate('AppFlows')} />
3938
<ListTile title="WebViews" onPress={() => navigation.navigate('WebViews')} />
4039
<ListTile title="Complex Views" onPress={() => navigation.navigate('ComplexViews')} />

examples/default/src/screens/apm/TracesScreen.tsx

Lines changed: 0 additions & 70 deletions
This file was deleted.

ios/RNInstabug/InstabugAPMBridge.m

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -61,41 +61,6 @@ - (id) init
6161
IBGAPM.autoUITraceEnabled = isEnabled;
6262
}
6363

64-
// Starts new execution trace with the specified `name`.
65-
//
66-
// Deprecated see [startFlow: (NSString *)name]
67-
RCT_EXPORT_METHOD(startExecutionTrace:(NSString *)name :(NSString *)id
68-
:(RCTPromiseResolveBlock)resolve
69-
:(RCTPromiseRejectBlock)reject) {
70-
IBGExecutionTrace *trace = [IBGAPM startExecutionTraceWithName:name];
71-
if (trace != nil) {
72-
[traces setObject: trace forKey: id];
73-
resolve(id);
74-
} else {
75-
resolve([NSNull null]);
76-
}
77-
}
78-
79-
// Sets a user defined attribute for the execution trace.
80-
//
81-
// Deprecated see [setFlowAttribute:(NSString *)name :(NSString *)key :(NSString *_Nullable)value]
82-
RCT_EXPORT_METHOD(setExecutionTraceAttribute:(NSString *)id :(NSString *)key :(NSString *)value) {
83-
IBGExecutionTrace *trace = [traces objectForKey:id];
84-
if (trace != nil) {
85-
[trace setAttributeWithKey:key value:value];
86-
}
87-
}
88-
89-
// Ends execution trace with the specified `name`.
90-
//
91-
// Deprecated see [endFlow: (NSString *)name]
92-
RCT_EXPORT_METHOD(endExecutionTrace:(NSString *)id) {
93-
IBGExecutionTrace *trace = [traces objectForKey:id];
94-
if (trace != nil) {
95-
[trace end];
96-
}
97-
}
98-
9964
// Starts a flow trace with the specified `name`,
10065
// allowing the SDK to capture and analyze the flow of execution within the application.
10166
RCT_EXPORT_METHOD(startFlow: (NSString *)name) {

ios/RNInstabug/InstabugBugReportingBridge.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ - (void) showBugReportingWithReportTypeAndOptionsHelper:(NSArray*)args {
216216
}
217217
}
218218

219-
[IBGBugReporting setCommentMinimumCharacterCountForReportTypes:parsedReportTypes withLimit:limit.intValue];
219+
[IBGBugReporting setCommentMinimumCharacterCount:limit.intValue forBugReportType:parsedReportTypes];
220220
}
221221

222222
RCT_EXPORT_METHOD(addUserConsent:(NSString *)key

ios/RNInstabug/InstabugReactBridge.m

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ - (dispatch_queue_t)methodQueue {
170170
}
171171

172172
RCT_EXPORT_METHOD(setPrimaryColor:(UIColor *)color) {
173-
Instabug.tintColor = color;
173+
Instabug.theme.primaryColor = color;
174174
}
175175

176176
RCT_EXPORT_METHOD(appendTags:(NSArray *)tags) {
@@ -355,18 +355,6 @@ - (dispatch_queue_t)methodQueue {
355355
}
356356
}
357357

358-
RCT_EXPORT_METHOD(addExperiments:(NSArray *)experiments) {
359-
[Instabug addExperiments:experiments];
360-
}
361-
362-
RCT_EXPORT_METHOD(removeExperiments:(NSArray *)experiments) {
363-
[Instabug removeExperiments:experiments];
364-
}
365-
366-
RCT_EXPORT_METHOD(clearAllExperiments) {
367-
[Instabug clearAllExperiments];
368-
}
369-
370358
RCT_EXPORT_METHOD(addFeatureFlags:(NSDictionary *)featureFlagsMap) {
371359
NSMutableArray<IBGFeatureFlag *> *featureFlags = [NSMutableArray array];
372360
for(id key in featureFlagsMap){

src/index.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// Models
22
import type { InstabugConfig } from './models/InstabugConfig';
33
import Report from './models/Report';
4-
import Trace from './models/Trace';
54
// Modules
65
import * as APM from './modules/APM';
76
import * as BugReporting from './modules/BugReporting';
@@ -19,7 +18,6 @@ import type { SessionMetadata } from './models/SessionMetadata';
1918
export * from './utils/Enums';
2019
export {
2120
Report,
22-
Trace,
2321
APM,
2422
BugReporting,
2523
CrashReporting,

src/models/Trace.ts

Lines changed: 0 additions & 33 deletions
This file was deleted.

src/modules/APM.ts

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { Platform } from 'react-native';
22

3-
import Trace from '../models/Trace';
43
import { NativeAPM } from '../native/NativeAPM';
54
import { NativeInstabug } from '../native/NativeInstabug';
65

@@ -48,29 +47,6 @@ export const setAutoUITraceEnabled = (isEnabled: boolean) => {
4847
NativeAPM.setAutoUITraceEnabled(isEnabled);
4948
};
5049

51-
/**
52-
* Starts a custom execution trace.
53-
*
54-
* Returns a promise which resolves with the trace reference if APM is enabled; otherwise, the promise is rejected.
55-
*
56-
* @param name - The name of the trace to start.
57-
* @returns A promise that resolves with a Trace object.
58-
*
59-
* @deprecated Please migrate to the App Flows APIs: {@link startFlow}, {@link endFlow}, and {@link setFlowAttribute}.
60-
*/
61-
export const startExecutionTrace = async (name: string): Promise<Trace> => {
62-
const TRACE_NOT_STARTED_APM_NOT_ENABLED = `Execution trace "${name}" wasn't created. Please make sure to enable APM first by following the instructions at this link: https://docs.instabug.com/reference#enable-or-disable-apm`;
63-
const timestamp = Date.now() + '';
64-
65-
const id = await NativeAPM.startExecutionTrace(name, timestamp);
66-
67-
if (!id) {
68-
throw new Error(TRACE_NOT_STARTED_APM_NOT_ENABLED);
69-
}
70-
71-
return new Trace(id, name);
72-
};
73-
7450
/**
7551
* Starts an AppFlow with the specified name.
7652
*

src/modules/BugReporting.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,10 @@ export const setDisclaimerText = (text: string) => {
245245
* Sets a minimum number of characters as a requirement for the comments field in the different report types.
246246
* @param limit int number of characters.
247247
* @param reportTypes (Optional) Array of reportType. If it's not passed, the limit will apply to all report types.
248+
* @platform iOS
248249
*/
249250
export const setCommentMinimumCharacterCount = (limit: number, reportTypes?: ReportType[]) => {
250-
NativeBugReporting.setCommentMinimumCharacterCount(limit, reportTypes ?? []);
251+
if (Platform.OS === 'ios') {
252+
NativeBugReporting.setCommentMinimumCharacterCount(limit, reportTypes ?? []);
253+
}
251254
};

0 commit comments

Comments
 (0)