user3491799
user3491799

Reputation: 322

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

Upvotes: 3

Views: 4878

Answers (1)

user3491799
user3491799

Reputation: 322

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

Upvotes: 9

Related Questions