react-native-push-notification

React Native Push Notification Not Working Properly

北战南征 提交于 2021-02-11 12:03:33
问题 Push Notification function: PushNotification.configure({ largeIcon: "ic_launcher", smallIcon: "ic_notification", onNotification: function (notification) { PushNotification.localNotification({ autoCancel: true, message: 'Test Message', title: 'Test Message', vibrate: true, vibration: 300, playSound: true, soundName: 'default' }) console.log(notification) }, }); Problem: When I run application, if I send notification from php server I am getting response in console.log but condition 1:

React Native How to redirect on page when click on notification

北战南征 提交于 2021-01-28 13:50:51
问题 I’m using react-native-push-notification on a page with a timer. If the application is in the background after 5 minutes, I’m notified that time has passed. When I click on the notification, it goes to this page. But when I close the application completely and after 5 minutes I click on the notification, it goes to the start page. Now the question is how to make it go to this page? // let remainingTime = (this.state.minute * 60 + this.state.seconds) * 1000; let date = new Date(Date.now() +

React Native How to redirect on page when click on notification

自古美人都是妖i 提交于 2021-01-28 13:47:55
问题 I’m using react-native-push-notification on a page with a timer. If the application is in the background after 5 minutes, I’m notified that time has passed. When I click on the notification, it goes to this page. But when I close the application completely and after 5 minutes I click on the notification, it goes to the start page. Now the question is how to make it go to this page? // let remainingTime = (this.state.minute * 60 + this.state.seconds) * 1000; let date = new Date(Date.now() +

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

Android onNotification never called in react-native-push-notification

送分小仙女□ 提交于 2019-12-11 06:47:28
问题 PushNotification.configure({ onNotification: function(notification) { console.log( 'NOTIFICATION:', notification); }, }) notification received form the server when i clicked on it app is opened but onNotification never called. i put this in componentDidMount() and constructor in App.js but it's never called.. help.. 回答1: Did you add the required code into the AndroidManifest.xml? For example : <!--more stuff above--> <service android:name="com.dieam.reactnativepushnotification.modules