forked from BlueWallet/BlueWallet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathanalytics.js
44 lines (36 loc) · 1015 Bytes
/
analytics.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
import { getUniqueId } from 'react-native-device-info';
import Bugsnag from '@bugsnag/react-native';
const BlueApp = require('../BlueApp');
let userHasOptedOut = false;
if (process.env.NODE_ENV !== 'development') {
Bugsnag.start({
collectUserIp: false,
user: {
id: getUniqueId(),
},
onError: function (event) {
return !userHasOptedOut;
},
});
}
BlueApp.isDoNotTrackEnabled().then(value => {
if (value) userHasOptedOut = true;
});
const A = async event => {};
A.ENUM = {
INIT: 'INIT',
GOT_NONZERO_BALANCE: 'GOT_NONZERO_BALANCE',
GOT_ZERO_BALANCE: 'GOT_ZERO_BALANCE',
CREATED_WALLET: 'CREATED_WALLET',
CREATED_LIGHTNING_WALLET: 'CREATED_LIGHTNING_WALLET',
APP_UNSUSPENDED: 'APP_UNSUSPENDED',
NAVIGATED_TO_WALLETS_HODLHODL: 'NAVIGATED_TO_WALLETS_HODLHODL',
};
A.setOptOut = value => {
if (value) userHasOptedOut = true;
};
A.logError = errorString => {
console.error(errorString);
Bugsnag.notify(new Error(String(errorString)));
};
module.exports = A;