{
"notification": {
"alert": "Rich Broadcast"
},
"message": {
"title": "Rich Title",
"body": "<html>The Body</html>",
"content_type": "text/html"
},
"audience": "all",
"device_types": "all"
}
工作正常,但当我尝试按别名过滤时,我得到一个错误的请求:
{
"notification": {
"alert": "Just one"
},
"message": {
"title": "The title, device registered to 1234567890 only",
"body": "<html>The body</html>",
"content_type": "text/html"
},
"audience": {
"alias": "01b307acba4f54f55aafc33bb06bbbf6ca803e9a"
},
"device_types": "all"
}
提出错误请求:
System.Net.WebException:远程服务器返回错误:(400)Bad Request。
任何人都可以发布一些有效的json吗?
答案 0 :(得分:0)
如果您发送丰富的推送,API将以400响应,但您不会将device_types限制为与富推送兼容的平台。这些不兼容的平台包括wns,mpns和blackberry。
{
"notification": {
"alert": "Just one"
},
"message": {
"title": "The title, device registered to 1234567890 only",
"body": "<html>The body</html>",
"content_type": "text/html"
},
"audience": {
"alias": "01b307acba4f54f55aafc33bb06bbbf6ca803e9a"
},
"device_types": ["ios","android"]
}