-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.js
60 lines (55 loc) · 1.66 KB
/
App.js
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
import React from 'react';
import {StatusBar, View} from 'react-native';
import {MenuProvider} from 'react-native-popup-menu';
import {PersistGate} from 'redux-persist/es/integration/react';
import {Provider} from 'react-redux';
import {lifecycle} from 'recompose';
import {store, persistor} from './app/store';
import Navigator from './app/navigation/NavigatorContainer';
import styles from './app/styles/AppStyles';
import colors from './app/styles/colors';
import {appOperations} from './app/modules/app';
import {Notifications} from 'expo';
console.ignoredYellowBox = ['MenuContext', 'Deprecation warning'];
class App extends React.Component {
render() {
return (
<MenuProvider>
<View style={styles.rootStyle}>
<StatusBar
barStyle="dark-content"
backgroundColor={colors.white}
/>
<Provider store={store}>
<PersistGate persistor={persistor}>
<Navigator/>
</PersistGate>
</Provider>
</View>
</MenuProvider>
);
}
};
const enhance = lifecycle({
componentDidMount() {
store.dispatch(appOperations.loadAssets());
// Create daily notification
const dailyNotification = {
title: 'Daily reminder',
body: 'Don\'t forget to update your financial state !',
ios: {
sound: true,
},
android: {
sound: true,
icon: './app/assets/images/app-icon.png',
},
};
const schedulingOptions = {
time: new Date().getTime() + 1000,
repeat: 'day',
};
Notifications.scheduleLocalNotificationAsync(dailyNotification, schedulingOptions);
},
});
export default enhance(App);