-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathApp.tsx
48 lines (37 loc) · 1.39 KB
/
App.tsx
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
import { ActionSheetProvider } from '@expo/react-native-action-sheet';
import React, { useEffect } from 'react';
import { View } from 'react-native';
import CodePush from 'react-native-code-push';
import { EnvironmentHelper } from "./src/helpers";
import AppNavigator from './src/navigation/AppNavigation';
// Need manually add Intl polyfill for react-native app
import { ApiHelper } from '@churchapps/mobilehelper';
import "intl";
import "intl/locale-data/jsonp/en";
import { Platform } from "react-native";
import { ErrorHelper } from './src/helpers/ErrorHelper';
if (Platform.OS === "android") {
// See https://github.com/expo/expo/issues/6536 for this issue.
if (typeof (Intl as any).__disableRegExpRestore === "function") {
(Intl as any).__disableRegExpRestore();
}
}
EnvironmentHelper.init();
const App = () => {
useEffect(() => {
ErrorHelper.init();
//ApiHelper.onRequest = (url:string, requestOptions:any) => { console.log("Request: ", url, requestOptions); }
ApiHelper.onError = (url: string, requestOptions: any, error: any) => { console.log("***API Error: ", url, requestOptions, error); }
}, []);
return (
<ActionSheetProvider>
<View style={{ flex: 1 }}>
<AppNavigator />
</View>
</ActionSheetProvider>
);
};
let codePushOptions = {
checkFrequency: CodePush.CheckFrequency.ON_APP_START,
}
export default CodePush(codePushOptions)(App);