-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
84 lines (74 loc) · 2.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
import React from 'react';
import {AppRegistry, YellowBox, LogBox} from 'react-native';
import App from './App';
import {name as appName} from './app.json';
import {
Colors,
DefaultTheme,
Provider as PaperProvider,
} from 'react-native-paper';
import stores from './src/mobx';
import {Provider} from 'mobx-react';
import * as Pref from '././src/util/Pref';
import {StatusBar, Platform} from 'react-native';
import codePush from 'react-native-code-push';
import './src/services/CallerServices';
import './src/services/IdleServices';
import './src/services/BubbleServices';
import './src/services/FirebaseServices';
const theme = {
...DefaultTheme,
colors: {
...DefaultTheme.colors,
primary: Pref.PRIMARY_COLOR,
accent: Pref.ACCENT_COLOR,
backgroundColor: Pref.BACKGROUND_COLOR,
surface: Colors.white,
},
};
console.disableYellowBox = true;
YellowBox.ignoreWarnings([
'VirtualizedList:',
'Animated: `useNativeDriver`',
'Require cycle:',
'Warning:',
'createStackNavigator',
]);
LogBox.ignoreAllLogs(true);
StatusBar.setBackgroundColor('white', false);
StatusBar.setBarStyle('dark-content');
function Main() {
return (
<Provider {...stores}>
<PaperProvider theme={theme}>
<App />
</PaperProvider>
</Provider>
);
}
const releasemode = true;
let codepushKey =
Platform.OS === 'ios' ? Pref.STAGING_CODE_PUSH_IOS : Pref.STAGING_CODE_PUSH;
if (releasemode === true) {
codepushKey =
Platform.OS === 'ios'
? Pref.PRODUCTION_CODE_PUSH_IOS
: Pref.PRODUCTION_CODE_PUSH;
}
const options = {
updateDialog: {
title: 'New Update Available',
appendReleaseDescription: true,
descriptionPrefix: 'Please, Install update to use app',
mandatoryContinueButtonLabel: 'Ok',
mandatoryUpdateMessage: 'Please, Install update to use app',
optionalInstallButtonLabel: 'Cancel',
},
installMode: codePush.InstallMode.IMMEDIATE,
checkFrequency: codePush.CheckFrequency.ON_APP_RESUME,
deploymentKey: codepushKey,
};
//codepush
AppRegistry.registerComponent(appName, () => codePush(options)(Main));
//main
//AppRegistry.registerComponent(appName, () => Main);