我想在单击通知时重定向到所选页面。下面是我的代码。
public pushNotification(){
const options: PushOptions = {
android: {
senderID: 'xxxxxxxx',
icon: 'icon',
sound: true,
vibrate: true
},
ios: {
alert: true,
badge: true,
sound: true,
}
};
let isNotifyAvailable: boolean = false;
const pushObject: PushObject = this.push.init(options);
let me = this;
pushObject.on('notification').subscribe((notification: any) => {
console.log('Received a notification', notification);
if (notification.additionalData.foreground) {
me.utilService.showToastMsg("success", notification.message);
} else {
this.navCtrl.setRoot(NotificationList);
}
});
}
在后端,我在Python中使用 FCM 通知。
单击“通知”时如何重定向所选页面?
答案 0 :(得分:0)
this.newacc[i].accounts