forked from kryptokrona/hugin-mobile
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
30 lines (22 loc) · 768 Bytes
/
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
// Copyright (C) 2018-2019, Zpalmtree
//
// Please see the included LICENSE file for more information.
import './shim';
import { AppRegistry } from 'react-native';
import BackgroundFetch from 'react-native-background-fetch';
import { name as appName } from './app.json';
import App from './src/App';
import { Globals } from './src/Globals';
import { backgroundSync } from './src/BackgroundSync';
/* Stub out console.log in production */
if (!__DEV__) {
console.log = () => {};
}
BackgroundFetch.registerHeadlessTask(async () => {
try {
await backgroundSync();
} catch (error) {
Globals.logger.addLogMessage("[js] RNBackgroundFetch failed to start: " + error.toString());
}
});
AppRegistry.registerComponent(appName, () => App);