【发布时间】:2017-09-04 20:04:04
【问题描述】:
我正在使用 Ionic 和 Firebase 测试 javebratt 的 fitCoach 推送通知示例。 javebratt/fitCoach
推送很好,但是当页面重定向发生时,我在手机上看到以下错误。
Error seen on device when clicking on notification, page redirection should happen here
Line in app.component.ts where navCtrl error is trigered
app.component.ts 中的代码如下:
platform.ready().then(() => {
fcm.onNotification().subscribe( data => {
if(data.wasTapped){
authUnsubscribe.unsubscribe();
//Notification was received on device tray and tapped by the user.
console.log( JSON.stringify(data) );
this.navCtrl.setRoot('ClientDetailPage', { 'clientId': data.clientId});
}else{
//Notification was received in foreground. Maybe the user needs to be notified.
console.log( JSON.stringify(data) );
this.navCtrl.push('ClientDetailPage', { 'clientId': data.clientId});
}
});
// Okay, so the platform is ready and our plugins are available.
// Here you can do any higher level native things you might need.
statusBar.styleDefault();
splashScreen.hide();
});
我从 github 克隆了他的 repo,有什么建议吗?
谢谢
【问题讨论】:
标签: typescript ionic-framework