{
  "notification": {
    "alert": "Rich Broadcast"
  },
 "message": {
    "title": "Rich Title",
    "body": "<html>The Body</html>",
    "content_type": "text/html"
  },
  "audience": "all",
  "device_types": "all"
}

Works fine, but when I attempt to filter by alias I get a bad request:

{
  "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"
}

Gives a bad request:

System.Net.WebException: The remote server returned an error: (400) Bad Request.

Can anyone post some json that works?

有帮助吗?

解决方案

The API will respond with a 400 if you are sending a rich push but you don't limit the device_types to platforms that are compatible with rich push. These incompatible platforms include wns, mpns, and 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"]
}
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top