1

i have been parse for a while and it is working fine. Now iam facing a problem on sending push notification. This i have done

curl -X POST \
 -H "X-Parse-Application-Id: application id" \
 -H "X-Parse-REST-API-Key: REST_API_KEY" \
 -H "Content-Type: application/json" \
 -d '{
 "channels":[''],
 "data": {
 "alert": "The Giants won against the Mets 2-3."
 }
 }' \
 https://api.parse.com/1/push

I meant to send a broadcast message. But in parse console it shows

Targeting :
channels includes any of , or nil
deviceType is any of "android", "winphone", or "js"
Sending date :
November 26th, 2013 at 4:32 PM
Expiration :
None
Full target :
{ "channels": { "$in": [ ] }, "deviceType": { "$in": [ "android", "winphone", "js" ] } }
Full data :
{ "alert": "The Giants won against the Mets 2-3." }

Iam not able to figure from where is '$in' key is been assigned for full target? Sending pushes using parse console is working fine.

How it can be solved?

Janusz
190k115 gold badges306 silver badges373 bronze badges
asked Nov 26, 2013 at 11:51

2 Answers 2

1

Its advanced targeting - REST API always ends up doing that - $in means the channels the push is to be send to... I am not 100% sure but you need to add a where: {} in your call if you want to broadcast to all... Cheers!

answered Nov 27, 2013 at 8:07
Sign up to request clarification or add additional context in comments.

1 Comment

Thanks for your answer. ok so thats '$in' is meant to be,was not aware of it and i had solved the issue it was the single quotes that created the issue. Replaced with double quotes and got the thing. Cheers...!!!!!
0

It may be silly but it made me nuts for hours. Simply it was the single quotes in channel array causing the problem. Changed to double quotes solved my issue.

answered Nov 27, 2013 at 11:39

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.