1***@qq.com
1***@qq.com
  • 发布:2017-09-06 08:58
  • 更新:2017-09-06 11:09
  • 阅读:4782

个推 苹果手机收到消息提醒,点击不跳转到指定页面

分类:HTML5+

我用个推来推送消息,安卓手机是正常的(既能收到消息点击可以跳转到指定页面),但是苹果手机不正常(能收到消息,但是不能跳转到指定页面)代码如下
plus.push.addEventListener("receive", function( msg ) {

if (msg.aps) {  // Apple APNS message(苹果接收)  
         router.push({path:msg.content})          
    } else {   //(安卓接收)  
        router.push({path:msg.content})  
}  

}, false );

2017-09-06 08:58 负责人:无 分享
已邀请:
freedemon

freedemon - 得于社区,反哺社区

不是不跳,是你触发消息有问题。
无论怎么样,你都先把你接受到的消息打印出来,看看是否跟你想象的消息格式一样,有大多时候就是不一样搞的鬼
另外,你不能用msg.aps来区分苹果安卓,苹果挂起状态apns才会有值,在线状态apns会为null。

  • 1***@qq.com (作者)

    好的,谢谢,我试下

    2017-09-06 11:01

1***@qq.com

1***@qq.com (作者) - 阿拉赛

plus.push.addEventListener("receive", function( msg ) {
if(plus.os.name == "iOS") {
router.push({path:msg.content})
} else {
router.push({path:msg.content})
}
}, false );
plus.push.addEventListener("click", function(msg) {
if(plus.os.name == "iOS") {
router.push({path:msg.content})
} else {
router.push({path:msg.content})
}
}, false );
请问这样写可以吗

该问题目前已经被锁定, 无法添加新回复