-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTestConnectNative.ts
38 lines (31 loc) · 942 Bytes
/
TestConnectNative.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// If TestConnectNative is an package from npm, you can think this is index.js file
import { NativeModules, Platform } from 'react-native';
const testConnectNative = NativeModules.TestConnectNative;
const TestConnectNative = {
sendMessage: (msg: string) => {
testConnectNative.sendMessageToNative(msg);
},
sendCallback: (callback: Function) => {
testConnectNative.sendCallbackToNative(callback);
},
exitRN: (tag: number) => {
if (Platform.OS === 'ios') {
testConnectNative.dismissViewController(tag);
} else {
testConnectNative.finishActivity();
}
},
goToNative: (tag: number) => {
if (Platform.OS === 'ios') {
testConnectNative.goToSecondViewController(tag);
} else {
testConnectNative.goToSecondActivity();
}
},
getToken: () => {
// if (Platform.OS === 'ios') {
return testConnectNative.getToken();
// }
},
};
export default TestConnectNative;