单击 android 和 iOS 上的推送通知后,我想重定向到收件箱屏幕
案例 1:应用程序已经在 android 上打开。- 成功工作
收到推送通知。单击通知页面成功重定向到收件箱。
NOTIFICATION: {"dealer": "SWRoa0ZhSkN4Y2hQNW1NeWtFdHFvSDNlcXIyNnc1TG5PS1hOZjJoMElHST0=", "finish": [Function finish], "foreground": false, "id": "-1073464079", "message": "hello", "messagetype": "RESPONSE", "subject": "ENQUIRY RESPONSE", "title": “Sample 1”, "userInteraction": true}
PushNotification.configure({
onNotification: function(notification) {
console.log("NOTIFICATION:", notification);
console.log('NOTIFICATION CLICK STATE : --->' + notification.userInteraction);
if(notification.userInteraction === true) {
NavigationService.navigate('Inbox');
}
},
popInitialNotification: true,
});
案例 2:应用程序在后台运行或在 android 上关闭 - 失败
收到推送通知。单击通知页面重定向不起作用,仅打开应用程序。
未收到通知数据
案例 3:在 IOS 上应用打开或关闭的情况。- 失败的
收到推送通知。单击通知页面重定向不起作用,仅打开应用程序。
未收到通知数据
我正在使用react-native-push-notification 库进行推送通知。
https://github.com/zo0r/react-native-push-notification