forked from secret-tech/aag-rn
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
38 lines (31 loc) · 1.04 KB
/
index.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
import React, { Component } from 'react';
import { AppRegistry } from 'react-native';
import { Root } from 'native-base';
import { Provider } from 'react-redux';
import OneSignal from 'react-native-onesignal';
import store from './src/redux/configureStore';
import { name as appName } from './app.json';
import AppNavigator from './src/navigation/AppNavigator';
class App extends Component {
componentWillMount() {
OneSignal.setLogLevel(7, 0);
OneSignal.init('96ef2fff-208d-4b7e-a592-6c45b3633fad', { kOSSettingsKeyAutoPrompt: true });
OneSignal.inFocusDisplaying(0);
OneSignal.addEventListener('opened', (n) => console.log('opened', n));
OneSignal.addEventListener('received', (n) => console.log('received', n));
}
componentWillUnmount() {
OneSignal.removeEventListener('received');
OneSignal.removeEventListener('opened');
}
render() {
return (
<Provider store={store}>
<Root>
<AppNavigator/>
</Root>
</Provider>
);
}
}
AppRegistry.registerComponent(appName, () => App);