-
Notifications
You must be signed in to change notification settings - Fork 57
Expand file tree
/
Copy pathApp.js
More file actions
84 lines (70 loc) · 1.99 KB
/
App.js
File metadata and controls
84 lines (70 loc) · 1.99 KB
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 {
StyleSheet,
StatusBar,
Platform
} from 'react-native'
import {TeaNavigator, Theme} from 'teaset';
import TabNavBar from './app/screens/TabNavBar';
import styleUtil from "./app/common/styleUtil";
import navigate from "./app/screens/navigate";
import Request from './app/common/request'
import config from './app/common/config'
import storageUtil from './app/common/storageUtil'
import toast from "./app/common/toast";
import SplashScreen from 'react-native-splash-screen'
import CodePush from 'react-native-code-push'
import IMessage from "./app/common/IMessage";
// import {Geolocation} from "react-native-amap-geolocation";
export const GeoLocation = Platform.OS === 'ios' ? null : require('react-native-amap-geolocation').Geolocation;
global.request = Request;
global.config = config;
global.storageUtil = storageUtil;
global.toast = toast;
global.imessage = new IMessage();
Theme.set({
fitIPhoneX: true,
tvBarBtnIconActiveTintColor: styleUtil.themeColor,
tvBarBtnActiveTitleColor: styleUtil.themeColor,
navColor: 'white',
backgroundColor: 'white',
navTintColor: 'black',
navTitleColor: 'black',
navSeparatorLineWidth: styleUtil.borderSeparator,
navSeparatorColor: styleUtil.borderColor,
navType: 'auto', //'auto', 'ios', 'android'
navStatusBarStyle: 'dark-content', //'default', 'light-content', 'dark-content'
});
class App extends React.Component {
constructor() {
super();
}
async componentWillMount() {
CodePush.sync({},() => {}, () => {});
if (GeoLocation) {
await GeoLocation.init({
ios: "",
android: ""
});
GeoLocation.setOptions({
interval: 8000,
distanceFilter: 20,
reGeocode: true
});
}
}
componentDidMount() {
SplashScreen.hide();
}
componentWillUnmount() {
}
render() {
return <TeaNavigator
ref={v => navigate.setContainer(v)}
rootView={<TabNavBar/>}
/>;
}
}
let codePushOptions = { checkFrequency: CodePush.CheckFrequency.MANUAL };
App = CodePush(codePushOptions)(App);
export default App;