Skip to content

Commit 86bbcb6

Browse files
committed
new architecture support for ios
1 parent cd9135b commit 86bbcb6

3 files changed

Lines changed: 47 additions & 1 deletion

File tree

ios/RnBugfender.mm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#import <React/RCTUtils.h>
44

55
#ifdef RCT_NEW_ARCH_ENABLED
6-
#import "RNRnBugfenderSpec.h"
6+
#import <RnBugfenderSpec/RnBugfenderSpec.h>
77
#endif
88

99
@implementation RnBugfender

package.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,5 +157,13 @@
157157
}
158158
]
159159
]
160+
},
161+
"codegenConfig": {
162+
"name": "RnBugfenderSpec",
163+
"type": "modules",
164+
"jsSrcsDir": "src",
165+
"android": {
166+
"javaPackageName": "com.bugfender.react"
167+
}
160168
}
161169
}

src/NativeRnBugfender.ts

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
import type {TurboModule} from 'react-native/Libraries/TurboModule/RCTExport';
2+
import {TurboModuleRegistry} from 'react-native';
3+
import type {Float,Int32} from 'react-native/Libraries/Types/CodegenTypes';
4+
5+
export interface Spec extends TurboModule {
6+
activateLogger(key: string): void;
7+
setApiUrl(apiUrl: string): void;
8+
setBaseUrl(baseUrl: string): void;
9+
setForceEnabled(enabled: boolean): void;
10+
overrideDeviceName(deviceName: string): void;
11+
setMaximumLocalStorageSize(size: number): void;
12+
getDeviceUrl(): Promise<string>;
13+
getSessionUrl(): Promise<string>;
14+
removeDeviceKey(key: string): void;
15+
enableLogcatLogging(): void;
16+
enableCrashReporting(): void;
17+
enableUIEventLogging(): void;
18+
setDeviceBoolean(deviceKey: string, boolValue: boolean): void;
19+
setDeviceString(deviceKey: string, stringValue: string): void;
20+
setDeviceInteger(deviceKey: string, intValue: Int32): void;
21+
setDeviceFloat(deviceKey: string, floatValue: Float): void;
22+
info(tag: string, text: string): void;
23+
trace(tag: string, text: string): void;
24+
fatal(tag: string, text: string): void;
25+
debug(tag: string, text: string): void;
26+
warning(tag: string, text: string): void;
27+
error(tag: string, text: string): void;
28+
log(lineNumber: Int32, method: string, file: string, logLevel: Int32, tag: string, message: string): void;
29+
sendIssue(tag: string, text: string): Promise<string>;
30+
sendCrash(tag: string, text: string): Promise<string>;
31+
forceSendOnce(): void;
32+
sendUserFeedback(title: string, text: string): Promise<string>;
33+
showUserFeedback(title: string, text: string): Promise<string>;
34+
}
35+
36+
export default TurboModuleRegistry.get<Spec>(
37+
'RnBugfender',
38+
) as Spec | null;

0 commit comments

Comments
 (0)