-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.js
More file actions
51 lines (44 loc) · 1.41 KB
/
Copy pathApp.js
File metadata and controls
51 lines (44 loc) · 1.41 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
import React, {Component} from 'react'
import {notificationManager} from './src/Services/Notification'
import { NavigationContainer } from '@react-navigation/native'
import { createStackNavigator } from '@react-navigation/stack'
import Index from './src/Screens/Index'
import Destination from './src/Screens/Destination'
const Stack = createStackNavigator()
const notificator = notificationManager;
export default class App extends Component {
constructor(props) {
super(props)
}
componentDidMount() {
notificator.agendNotification()
notificator.newChanel()
notificator.configuration()
}
sendNotify = () => {
notificator.showNotification(
1,
"As notificações estão funcionando!",
"As agendadas vão começar daqui 5 minutos",
{}, // data
{} // options
)
}
render() {
return(
<NavigationContainer>
<Stack.Navigator>
<Stack.Screen name="Home" options={{title: 'Fominha'}}>
{
({navigation}) => {notificator.setNavegator(navigation);
return(<Index navegator={navigation} sendNotification={this.sendNotify}/>)}
}
</Stack.Screen>
<Stack.Screen name="Destination" options={{title: 'Detalhes'}}>
{({navigation}) => {return(<Destination navegator={navigation} />)}}
</Stack.Screen>
</Stack.Navigator>
</NavigationContainer>
)
}
}