-
Notifications
You must be signed in to change notification settings - Fork 18
/
index.js
37 lines (28 loc) · 962 Bytes
/
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
/**
* Created by tdzl2_000 on 2015-12-29.
*/
import { NativeModules } from 'react-native';
const nativeModule = NativeModules.TalkingDataAPI;
export function trackPageBegin(page_name) {
nativeModule.trackPageBegin(page_name);
}
export function trackPageEnd(page_name) {
nativeModule.trackPageEnd(page_name);
}
export function trackEvent(event_name, event_label, parameters) {
nativeModule.trackEvent(event_name, event_label, parameters);
}
export function setLocation(latitude, longitude) {
nativeModule.setLocation(latitude, longitude);
}
export function getDeviceID() {
return new Promise(resolve=>{
nativeModule.getDeviceID(resolve);
})
}
export async function applyAuthCode(countryCode, mobile, requestId) {
return await nativeModule.applyAuthCode(countryCode, mobile, requestId);
}
export async function verifyAuthCode(countryCode, mobile, authCode) {
return await nativeModule.verifyAuthCode(countryCode, mobile, authCode);
}