Send push notification via REST API in Parse.com {“code”:115,“error”:“Missing the push data.”}

匿名 (未验证) 提交于 2019-12-03 07:36:14

问题:

When i am trying to test the REST API provided by Parse.com with Fiddler, it return an error. please find the enclosed screen capture. I can send the push notification on parse.com. but not from REST API.

Screenshot here:
http://s24.postimg.org/stwspcyir/image.jpg
http://s9.postimg.org/5r3guagh9/image.jpg

=== Follow Up === found the correct syntax of the JSON for push notification:

{"data": { "alert": "test message", "sound": "", "badge": "Increment" },"channel":"abc"} 

but i found that if the channel is empty, the notification will not work, all i have to do is create channels for the device..... is it true ??

回答1:

Found the answer finally:

if you have channels, provide the channel name:

{"data": { "alert": "321213", "sound": "", "badge": "Increment" },"channel":"channel name"} 

if there is no channels (default no channel), send to all devices:

{"data": { "alert": "321213", "sound": "", "badge": "Increment" },"where": { "deviceType": "ios" }} 


易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!