forked from charlires/react-native-segment-analytics
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
27 lines (21 loc) · 620 Bytes
/
index.js
File metadata and controls
27 lines (21 loc) · 620 Bytes
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
import {
NativeModules,
} from 'react-native';
const {SegmentAnalytics} = NativeModules;
export default {
setup: function (configKey: string) {
SegmentAnalytics.setup(configKey);
},
identify: function (userId: string, traits: Object) {
SegmentAnalytics.identify(userId, traits);
},
track: function (trackText: string, properties: Object) {
SegmentAnalytics.track(trackText, properties);
},
screen: function (screenName: string, properties: Object) {
SegmentAnalytics.screen(screenName, properties);
},
alias: function (newId: string) {
SegmentAnalytics.alias(newId);
}
};