2014-02-21 64 views
0
{ 
    "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: The remote server returned an error: (400) Bad Request.

任何人都可以發佈一些JSON的作品?

回答

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