【发布时间】:2017-10-09 06:47:04
【问题描述】:
- phonegap-plugin-push
- 离子框架:3.6.0
- Ionic 应用脚本:2.1.4
- Angular 核心:4.1.3
- Angular 编译器 CLI:4.1.3
- 节点:6.11.1
- 操作系统平台:Windows 10
- 导航平台:Win32
-
用户代理:Mozilla/5.0(Windows NT 10.0;Win64;x64) AppleWebKit/537.36(KHTML,像 Gecko)Chrome/60.0.3112.113 Safari/537.36
当应用程序打开并接收通知时,它可以完美运行,它会自动重定向到特定页面。但是当应用程序关闭并且我点击通知时,它不会重定向到页面。它只会启动应用程序。
在通知代码上推送对象
pushObject.on('notification').subscribe((notification: any) => {
console.log('Received a notification', notification);
if(notification.additionalData.type=="news"){
this.NewsAndEventsDetails(notification.additionalData.type_id);
}else if(notification.additionalData.type=="notice"){
this.getNoticesSingle(notification.additionalData.type_id);
}else if(notification.additionalData.type=="bill"){
this.getBillsSingle(notification.additionalData.type_id);
}else{
let prompt = this.alertCtrl.create({
title: notification.title,
message: notification.message
});
prompt.present();
}
});
【问题讨论】:
标签: angular ionic-framework ionic3 phonegap-pushplugin