-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.tsx
55 lines (50 loc) · 1.63 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
49
50
51
52
53
54
55
import * as React from 'react';
import {NavigationContainer} from '@react-navigation/native';
import {Provider} from 'react-redux';
import {Store} from './src/Store';
import Routes from './src/Routes';
import {AlertNotificationRoot} from 'react-native-alert-notification';
import {AutocompleteDropdownContextProvider} from 'react-native-autocomplete-dropdown';
import 'react-native-get-random-values';
import { COLORS, MAINCOLORS } from '~/Utils/Colors';
import {ThemeProvider} from '@rneui/themed';
import {theme} from '~/Components/Theme';
import './gesture-handler';
/* import messaging from '@react-native-firebase/messaging'; */
const MyTheme = {
dark: true,
colors: {
primary: MAINCOLORS.primary,
background: '#FFFFFF',
card: '#FFFFFF',
text: 'rgba(0, 0, 0, 1)',
notification: COLORS.grey6,
},
};
export default function App() {
async function requestUserPermission() {
const authStatus = await messaging().requestPermission();
const enabled =
authStatus === messaging.AuthorizationStatus.AUTHORIZED ||
authStatus === messaging.AuthorizationStatus.PROVISIONAL;
if (enabled) {
console.log('Authorization status:', authStatus);
}
}
React.useEffect(() => {
requestUserPermission();
}, []);
return (
<Provider store={Store}>
<AlertNotificationRoot>
<AutocompleteDropdownContextProvider>
<ThemeProvider theme={theme}>
<NavigationContainer theme={MyTheme}>
<Routes />
</NavigationContainer>
</ThemeProvider>
</AutocompleteDropdownContextProvider>
</AlertNotificationRoot>
</Provider>
);
}