-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.js
118 lines (114 loc) · 3.32 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
import {StyleSheet, ScrollView,Image, View, Button, BackgroundImage,StatusBar,AppState,Alert} from 'react-native';
import LinearGradient from 'react-native-linear-gradient';
import React, {Component} from 'react';
import Navigation from './router';
import {Root} from "native-base";
import Navigator from './router';
import { Provider } from 'react-redux';
import Store from './redux/store';
import {Container} from 'native-base';
import Banner from './components/banner';
import Handler from './components/handler';
import ScoresHandler from './components/scoresHandler';
import ZapicHandler from './components/ZapicHandler/zapicHandler';
import MusicPlayer from './components/musicPlayer';
import { AppRegistry } from 'react-native';
import LocalizedStrings from 'react-native-localization';
import Strings from './components/localization';
import Sound from 'react-native-sound';
import * as settingsActions from './pages/Settings/settingsActions';
import SplashScreen from 'react-native-splash-screen';
var PushNotification = require('react-native-push-notification');
PushNotification.configure({
onRegister: function(token) {
console.log( 'TOKEN:', token );
},
onNotification: function(notification) {
console.log( 'NOTIFICATION:', notification );
notification.finish(PushNotificationIOS.FetchResult.NoData);
},
permissions: {
alert: true,
badge: true,
sound: true
},
popInitialNotification: true,
requestPermissions: true,
});
PushNotification.cancelAllLocalNotifications()
PushNotification.localNotificationSchedule({
message: Strings.notification,
date: new Date(Date.now() + (604800000)) // in 1 week
});
export default class App extends Component {
constructor(props){
super(props)
this.state = {
appState: AppState.currentState
}
}
componentDidMount() {
SplashScreen.hide()
}
render() {
console.disableYellowBox = true;
return (
<Container>
<StatusBar
backgroundColor="#164593"
barStyle="light-content"
hidden={true}
/>
<LinearGradient colors={['#164593', '#2b62bc', '#0073BB']} style={styles.linearGradient}>
<Provider store={Store}>
<Root style={styles.root}>
<ZapicHandler />
<MusicPlayer />
<Handler/>
<ScoresHandler matches = {{
winEasy:0,
lostEasy:0,
timeEasy:0,
bestTimeEasy:0,
winMedium:0,
lostMedium:0,
timeMedium:0,
bestTimeMedium:0,
winHard:0,
lostHard:0,
timeHard:0,
bestTimeHard:0,
winVeryHard:0,
lostVeryHard:0,
timeVeryHard:0,
bestTimeVeryHard:0,
winInsane:0,
lostInsane:0,
timeInsane:0,
bestTimeInsane:0,
winImpossible:0,
lostImpossible:0,
timeImpossible:0,
bestTimeImpossible:0
}} />
<Navigator/>
</Root>
</Provider>
</LinearGradient>
<Banner />
</Container>
);
}
}
const styles = StyleSheet.create({
linearGradient: {
flex: 1,
height:"100%",
paddingRight:15,
paddingLeft:15
},
content: {
paddingLeft: 15,
paddingRight: 15,
},
});