Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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 ??

like image 871
user3491799 Avatar asked Feb 03 '26 19:02

user3491799


1 Answers

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" }}
like image 125
user3491799 Avatar answered Feb 05 '26 12:02

user3491799



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!