-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.tsx
More file actions
39 lines (35 loc) · 1.23 KB
/
App.tsx
File metadata and controls
39 lines (35 loc) · 1.23 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
import React, { useEffect } from 'react';
import styled from 'styled-components/native';
import { NavigationContainer } from '@react-navigation/native';
import { createNativeStackNavigator } from '@react-navigation/native-stack';
import EventsList from './screens/eventsList';
import CreateEvent from './screens/createEvent';
import store from "./store";
import { Provider } from "react-redux";
import Toast from "react-native-toast-message"
import PushNotification from "react-native-push-notification";
const App = () => {
const Stack = createNativeStackNavigator();
useEffect(() => {
createChannel() ;
}, []);
const createChannel = () => {
PushNotification.createChannel({
channelId: "channelid",
channelName: "Test Name"
},
(created) => console.log(`createChannel returned '${created}'`) )
}
return (
<Provider store={store}>
<NavigationContainer>
<Stack.Navigator>
<Stack.Screen name="EventsList" component={EventsList} options={{ title: "My Events" }} />
<Stack.Screen name="CreateEvent" component={CreateEvent} options={{ title: "Create New Event" }} />
</Stack.Navigator>
</NavigationContainer>
<Toast />
</Provider>
);
};
export default App;