-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.js
47 lines (35 loc) · 1.09 KB
/
index.js
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
39
40
41
42
43
44
45
46
47
import {NativeModules, DeviceEventEmitter} from 'react-native';
const {RNReactNativeMsa} = NativeModules;
const listeners = {};
const TAG = 'RNReactNativeMsaModule';
class MsaModule {
static initSDK = async(params) => {
return await RNReactNativeMsa.initSDK(params);
}
static isSupport = async() => {
return await RNReactNativeMsa.isSupport();
}
static getOAID = async() => {
return await RNReactNativeMsa.getOAID();
}
static getVAID = async() => {
return await RNReactNativeMsa.getVAID();
}
static getAAID = async() => {
return await RNReactNativeMsa.getAAID();
}
static isLimit = async() => {
return await RNReactNativeMsa.isLimit();
}
static addReceiveMsaIdsListener = (cb) => {
listeners[cb] = DeviceEventEmitter.addListener(TAG + 'addReceiveMsaIdsListener', cb);
}
static removeListener = (callback) => {
if (!listeners[callback]) {
return;
}
listeners[callback].remove();
listeners[callback] = null;
}
}
export default MsaModule;