forked from eriben/react-native-analytics-segment-io
-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.js
57 lines (45 loc) · 1.39 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
48
49
50
51
52
53
54
55
56
57
import { NativeModules } from 'react-native'
const RNASegmentIO = NativeModules.RNASegmentIO || NativeModules.SegmentModule
export default {
setup: function (key, options = {}) {
return RNASegmentIO.setup(key, options)
},
identify: function (userId, traits = {}) {
RNASegmentIO.identify(userId, traits)
},
track: function (event, properties = {}) {
RNASegmentIO.track(event, properties)
},
screen: function (name, properties = {}) {
RNASegmentIO.screen(name, properties)
},
group: function (groupId, traits = {}) {
RNASegmentIO.group(groupId, traits)
},
alias: function (newId) {
RNASegmentIO.alias(newId)
},
reset: function () {
RNASegmentIO.reset()
},
flush: function () {
RNASegmentIO.flush()
},
enable: function () {
RNASegmentIO.enable()
},
disable: function () {
RNASegmentIO.disable()
}
}
export const AnalyticsConstants = {
enableAdvertisingTracking: RNASegmentIO.enableAdvertisingTracking,
flushAt: RNASegmentIO.flushAt,
recordScreenViews: RNASegmentIO.recordScreenViews,
shouldUseBluetooth: RNASegmentIO.shouldUseBluetooth,
shouldUseLocationServices: RNASegmentIO.shouldUseLocationServices,
trackApplicationLifecycleEvents: RNASegmentIO.trackApplicationLifecycleEvents,
trackAttributionData: RNASegmentIO.trackAttributionData,
trackDeepLinks: RNASegmentIO.trackDeepLinks,
debug: RNASegmentIO.debug,
}