关于v3/push接口message和notification同时存在ios端的消息优先级问题

shun
2018-08-29 03:43 1.6k 0

经使用发现接口 https://api.jpush.cn/v3/push 设置body的时候jsonobject对象同时存在message、notification的时候推送后在控制台看到ios端始终为自定义消息、且ios端接收目标设备均为自定义设备;

消息体样式

{
    "notification": {
        "alert": "TEST_MESSAGE_CONTENT",
        "android": {
            "extras": {
                "xx": "cccc"
            }
        },
        "ios": {
            "sound": "sound.caf",
            "extras": {
                "xx": "cccc"
            }
        }
    },
    "audience": {
        "registration_id": [
            "rid1",
            "rid2"
        ]
    },
    "options": {
        "apns_production": true
    },
    "message": {
        "content_type": "text",
        "msg_content": "TEST_MESSAGE_CONTENT",
        "title": "TEST_MESSAGE_TITLE"
    },
    "platform": "all"
}

问题:
1、是否在ios端message字段的优先级高于notification ?
2、该结构如何区分出是自定义消息还是通知消息?
3、是否存在type这种属性字段的来区分这是一条自定义消息还是通知消息?

1个回答

热门排序
  • 1、二者不存在优先级的问题,区别https://community.jiguang.cn/article/104021 2、Notification 就是通知,Message 就是自定义消息,客户端接收两种消息的方法是不一样的,自行查看文档 展示全部