|
2 | 2 |
|
3 | 3 | import './globalize-fetch' |
4 | 4 | import './setup-moment' |
5 | | -import OneSignal from 'react-native-onesignal' |
6 | 5 |
|
7 | 6 | import * as React from 'react' |
8 | 7 | import {Provider} from 'react-redux' |
@@ -36,45 +35,13 @@ type Props = {} |
36 | 35 |
|
37 | 36 | export default class App extends React.Component<Props> { |
38 | 37 | componentWillMount() { |
39 | | - OneSignal.addEventListener('received', this.onReceived) |
40 | | - OneSignal.addEventListener('opened', this.onOpened) |
41 | | - OneSignal.addEventListener('registered', this.onRegistered) |
42 | | - OneSignal.addEventListener('ids', this.onIds) |
43 | | - |
44 | | - // When we finally want to ask for push notifications, enable this: |
45 | | - // OneSignal.registerForPushNotifications() |
46 | | - |
47 | 38 | startStatusBarColorChanger() |
48 | 39 | } |
49 | 40 |
|
50 | 41 | componentWillUnmount() { |
51 | | - OneSignal.removeEventListener('received', this.onReceived) |
52 | | - OneSignal.removeEventListener('opened', this.onOpened) |
53 | | - OneSignal.removeEventListener('registered', this.onRegistered) |
54 | | - OneSignal.removeEventListener('ids', this.onIds) |
55 | | - |
56 | 42 | stopStatusBarColorChanger() |
57 | 43 | } |
58 | 44 |
|
59 | | - onReceived(notification: any) { |
60 | | - console.log('Notification received:', notification) |
61 | | - } |
62 | | - |
63 | | - onOpened(openResult: any) { |
64 | | - console.log('Message:', openResult.notification.payload.body) |
65 | | - console.log('Data:', openResult.notification.payload.additionalData) |
66 | | - console.log('isActive:', openResult.notification.isAppInFocus) |
67 | | - console.log('openResult:', openResult) |
68 | | - } |
69 | | - |
70 | | - onRegistered(notifData: any) { |
71 | | - console.log('Device is now registered for push notifications!', notifData) |
72 | | - } |
73 | | - |
74 | | - onIds(device: any) { |
75 | | - console.log('Device info:', device) |
76 | | - } |
77 | | - |
78 | 45 | trackScreenChanges( |
79 | 46 | prevState: NavigationState, |
80 | 47 | currentState: NavigationState, |
|
0 commit comments