Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/105.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angular/33.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何通过接收推送通知在ios上打开指定页面_Ios_Angular_Ionic2 - Fatal编程技术网

如何通过接收推送通知在ios上打开指定页面

如何通过接收推送通知在ios上打开指定页面,ios,angular,ionic2,Ios,Angular,Ionic2,我已注册设备令牌 this.push.register().then((t: PushToken) => { return this.push.saveToken(t); }).then((t: PushToken) => { console.log('Token saved:', t.token); }); 我也收到推送通知。这很好。 但我想在点击时打开一个特定的查看页面 将手柄推到这里: this.push.rx.notification() .subscribe(

我已注册设备令牌

this.push.register().then((t: PushToken) => {
  return this.push.saveToken(t);
}).then((t: PushToken) => {
  console.log('Token saved:', t.token);
});
我也收到推送通知。这很好。 但我想在点击时打开一个特定的查看页面

将手柄推到这里:

this.push.rx.notification()
  .subscribe((msg) => {
    alert(msg.title + ': ' + msg.text);
  });

有什么想法吗?

您是否从后端获得了通知类型的内容,以便导航可以顺利工作?是否需要启用后台通知?是的,您需要检查这一点,无论您的应用程序是在后台还是前台。比如:if(data.additionalData.foreground){},实际上需要知道来自后端的响应是什么。好的,如何获取playload项?使用ionic run android--l--c,然后使用chrome://inspect ,您可以在那里选择您的设备,然后您可以使用调试选项捕获后端响应