-
Notifications
You must be signed in to change notification settings - Fork 56
/
Copy pathindex.js
63 lines (59 loc) · 1.61 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
58
59
60
61
62
63
var {
NativeModules: {
RNHockeyApp
}
} = require('react-native');
var invariant = require('invariant');
function checkInstalled() {
invariant(RNHockeyApp, 'react-native-hockeyapp platform setup not complete');
}
export const AuthenticationType = {
Anonymous: 0,
EmailSecret: 1,
EmailPassword: 2,
DeviceUUID: 3,
Web: 4
};
export const HockeyApp = {
AuthenticationType: {
Anonymous: 0,
EmailSecret: 1,
EmailPassword: 2,
DeviceUUID: 3,
Web: 4
},
configure(apiToken, autoSendCrashes, authenticationType, apiSecret, ignoreDefaultHandler) {
checkInstalled();
RNHockeyApp.configure(apiToken, autoSendCrashes || true, authenticationType || 0, apiSecret || '', ignoreDefaultHandler || false);
},
start() {
checkInstalled();
RNHockeyApp.start();
},
checkForUpdate() {
checkInstalled();
RNHockeyApp.checkForUpdate();
},
feedback() {
checkInstalled();
RNHockeyApp.feedback();
},
addMetadata(metadata) {
checkInstalled();
var json = JSON.stringify(metadata);
RNHockeyApp.addMetadata(json);
},
generateTestCrash() {
checkInstalled();
RNHockeyApp.generateTestCrash();
},
trackEvent(eventName) {
checkInstalled();
RNHockeyApp.trackEvent(eventName);
},
trackEventWithOptionsAndMeasurements(eventName, options, measurements) {
checkInstalled();
RNHockeyApp.trackEventWithOptionsAndMeasurements(eventName, options || {}, measurements || {});
}
}
export default HockeyApp;