jpush / jpush-phonegap-plugin

JPush's officially supported PhoneGap/Cordova plugin (Android & iOS). 极光推送官方支持的 PhoneGap/Cordova 插件(Android & iOS)。
https://docs.jiguang.cn
MIT License
925 stars 350 forks source link

ionic3 集成极光推送之后 能获取到数据,但是不能跳转内页 #386

Closed YLQZ closed 5 years ago

YLQZ commented 5 years ago

WARNING: 如果不按照这个表格,我们将无法帮助你,并将忽略你的问题。

你的运行环境

期望效果

点击推送的消息之后,跳转到消息指定的页面

实际效果

点击推送消息之后,只是打开了应用

重现步骤

  1. ionic集成极光推送
  2. 监听 jpush.openNotification 事件
  3. document.addEventListener( "jpush.openNotification", (event:any)=>{ var content let data ='' var page = '' var sessionId = '' if (this.devicePlatform == "Android") { content = event.alert data = JSON.parse(event.extras['androidNotification extras key']) page = JSON.parse(event.extras['androidNotification extras key']).page sessionId = JSON.parse(event.extras['androidNotification extras key']).seeeionId } else { // iOS if (event.aps == undefined) { // 本地通知 content = event.content } else { // APNS content = event.aps.alert } } alert("open notification: " + JSON.stringify(event)) alert(page) alert(sessionId) alert(data) // this.goToChatPage(page,sessionId) this.navCtrl.push(page, { sessionId: sessionId }) }, false )

背景

你尝试做过些什么?

Debug logs

包括 Android 或 iOS 的日志:

JoshLipan commented 5 years ago

是收不到 openNotification 事件?

YLQZ commented 5 years ago

@JoshLipan 额中午服务器是不是停了,发不了了。 我这边的问题是能收到事件,也能获取参数,但是 在ionic中 点击消息之后,如何跳转到参数指定的页面上去 this.navCtrl.push(page, {sessionId: sessionId}) 这样子写,不执行跳转,不执行跳转

JoshLipan commented 5 years ago

网络故障,服务目前正在修复中。 收到事件后的逻辑要自己去处理,具体无法跳转原因需要你自己去定位

YLQZ commented 5 years ago

@JoshLipan 那我这种小白是不是不适合做开发了0.0

Toooooooooo commented 5 years ago

@YLQZ 打个debug-apk包查在as 查看一下 报错信息,检查一下 页面模板的引入和声明有没有问题。