-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.android.js
30 lines (25 loc) · 1.09 KB
/
index.android.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
import './App/Config/ReactotronConfig'
import { AppRegistry } from 'react-native'
import App, { onPushRegistered, onNotificationOpened, onNotificationReceived } from './App/Containers/App'
import {NotificationsAndroid, PendingNotifications} from 'react-native-notifications';
function handleOnPushRegistered() {
if (onPushRegistered) {
onPushRegistered();
}
}
function handleOnNotificationOpened(notification) {
if (onNotificationOpened) {
onNotificationOpened(notification)
}
}
function handleOnNotificationReceived(notification) {
if (onNotificationReceived) {
onNotificationReceived(notification)
}
}
// It's highly recommended to keep listeners registration at global scope rather than at screen-scope seeing that
// component mount and unmount lifecycle tend to be asymmetric!
NotificationsAndroid.setRegistrationTokenUpdateListener(handleOnPushRegistered);
NotificationsAndroid.setNotificationOpenedListener(handleOnNotificationOpened);
NotificationsAndroid.setNotificationReceivedListener(handleOnNotificationReceived);
AppRegistry.registerComponent('SmartUniApp', () => App)