ios - Urban Airship 显示错误的 JSON 有效负载
问题描述
我正在尝试从 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"
]
}
解决方案
这有效,你忘了一个逗号,你可以使用https://jsonlint.com 来做这样的事情
{
"audience": {
"ios_channel": "938a3a93-1a5f-466c-923b-827ef4b0a75b"
},
"notification": {
"aps": {
"alert": {
"body": "Sample",
"title": "Sample"
}
},
"ios": {
"badge": 3
}
},
"device_types": [
"ios"
]
}
推荐阅读
- ruby-on-rails - 删除关联时运行回调
- reactjs - 如何在 react.js 中获取 URL 段
- html - 如何停止从角度 2+ 中的剑道 ui 网格标题触发双击事件?
- c# - Sum(column) 的自定义名称,表为变量
- java - 阻止访问控制允许来源'
- php - 如何在boxapi上的同一个盒子帐户上协作两个文件夹?
- java - 如何使用 impala 或 hive jdbc 驱动程序执行 kudu 查询(使用 jdbcTemplate.update 方法)
- c# - Unity 中关于实例化对象的 AABB 错误的原因是什么?
- javascript - jsdoc 类如何具有静态属性
- javascript - ISSLive Telemetry: Locking Protocol SQLite3 C++ error on query, with Javascript code update the same SQLite3 database, all on WSL