城市飞艇显示错误的JSON负载

时间:2018-07-18 15:38:56

标签: ios notifications push

我正在尝试从Urban Airship门户发送测试推送。我有设备的通道ID,创建了JSON有效负载。但是,当我尝试发送时,它总是显示错误,抱歉,这看起来不像有效的JSON。以下是我的有效载荷数据,请为此提供帮助。

{
    "audience": {
        "ios_channel": "938a3a93-1a5f-466c-923b-827ef4b0a75b"
    },
    "notification": {
       "aps": {
            "alert": {
                "body": "Sample",
                "title": "Sample"
         }
       }
        "ios": {
            "badge": 3
        }
    },
    "device_types": [
        "ios"
    ]
} 

1 个答案:

答案 0 :(得分:0)

此有效,您忘记了逗号,可以将https://jsonlint.com用于此类事情

{
    "audience": {
        "ios_channel": "938a3a93-1a5f-466c-923b-827ef4b0a75b"
    },
    "notification": {
        "aps": {
            "alert": {
                "body": "Sample",
                "title": "Sample"
            }
        },
        "ios": {
            "badge": 3
        }
    },
    "device_types": [
    "ios"
    ]
}