【发布时间】:2018-11-21 08:30:52
【问题描述】:
我已经使用react-native-push-nofication 实现了推送通知,这是我的推送通知配置。
const configure = () => {
var _token
PushNotification.configure({
onRegister: function(token) {
//process token
//alert(JSON.stringify(token));
Clipboard.setString(JSON.stringify(token))
},
onNotification: function(notification) {
// process the notification
// required on iOS only
navigator.navigate(notification.data.url);
// notification.finish(PushNotificationIOS.FetchResult.NoData);
},
senderID: Config.GCMSENDERKEY,
permissions: {
alert: true,
badge: true,
sound: true
},
popInitialNotification: true,
requestPermissions: true,
});
};
此代码成功导航到期望路线,但是当应用程序处于后台时,当用户单击通知时,它会在导航到期望路线之前显示应用程序的根路线(启动画面)。我根本不想出现闪屏。
【问题讨论】:
标签: reactjs react-native react-native-push-notification