forked from martincik/react-native-hockeyapp
-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.js
46 lines (43 loc) · 1.12 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
var {
NativeModules: {
RNHockeyApp
}
} = require('react-native');
var invariant = require('invariant');
function checkInstalled(){
invariant(RNHockeyApp, 'react-native-hockeyapp platform setup not complete');
}
module.exports = {
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();
}
}