如何使用相同的有效负载发送丰富的(图像/数据)通知iOS和Android

时间:2019-05-08 20:01:23

标签: android ios react-native firebase-cloud-messaging

示例:

https://fcm.googleapis.com/fcm/send
POST

有效载荷:

{
    "to": "topics/myTopic",
    "content_available": true,
    "mutable_content": true,
    "priority": "high",
    "notification": {
        "title": "Happy Alert",
        "body": "We have some special offers available for you!",
        "attachment-url": "https://hello.scene7.com/is/image/officedepot/676092_p_1?$OD%2DMed$",
        "media_type": "image",
        "adUrl": "/coupon/XXXX",
        "intent": "tested",
        "sound": "default"
    },
    "data": {
        "title": "Happy Alert",
        "body": "We have some special offers available for you!",
        "attachment-url": "https://hello.scene7.com/is/image/officedepot/676092_p_1?$OD%2DMed$",
        "media_type": "image",
        "adUrl": "/coupon/XXXX",
        "intent": "tested",
        "sound": "default"
    }
}

我想使用相同的有效负载为iOS和Android发送通知。但是到目前为止,它不能正常工作。

0 个答案:

没有答案