react-native-push

react-native push notification onNotification doesn't trigger

拥有回忆 提交于 2019-12-24 01:33:10
问题 I am using zo0r react-native-push-notification library. "react": "16.0.0-alpha.12", "react-native": "^0.45.1", "react-native-push-notification": "^3.0.0" This code runs every time I open an app: PushNotification.configure({ onNotification: function(notification) { console.log('onNotification'); ToastAndroid.show('onNotification', 3000); } }); I send local push notification from background service: PushNotification.localNotification({ message: 'Hello World', smallIcon: 'ic_launcher' }); The

React Native Push Notification onNotification callback is inconsistent

為{幸葍}努か 提交于 2019-12-12 05:39:05
问题 I've been using react-native-push-notification library for quite some time for local notifications. Now I need remote silent notifications. Basically I send a notification that gets delivered to onNotification callback and I send local notification to the notification center. I expect onNotification callback to trigger every time I receive notification and I open an app by clicking on notification. The problem is, depending on where I call PushNotification.configure({...}) , on Android it