1

I Want to send a message to devices that registered to my app in parse, in registration i have added a column national_id

and now i want to send a message to specific national_id

what i tried:

JSONObject obj;
    try {
        obj = new JSONObject();
        obj.put("alert", "test");
        obj.put("action", "com.parse.pushnotifications.UPDATE_STATUS");
        obj.put("someData", "some additional data ");

        ParsePush push = new ParsePush();
        ParseQuery query = ParseInstallation.getQuery();
        query.whereEqualTo("national_id", nationalID);

        push.setQuery(query);
        push.setData(obj);
        push.sendInBackground();
    } catch (JSONException e) {
        e.printStackTrace();
    }

but desired device does not get any message

what is the problem? how can i solve it?

2 Answers 2

1

you have to enable client push notification in parse setting panel

Sign up to request clarification or add additional context in comments.

Comments

0

You have to add a few permissions and broadcast receiver information in your app manifest file before you cand send push notifications with parse. Head over to the Parse quickstart guide on push notifications in order to see which lines you have to add.

Your code seems ok, but you have to solve the manifest permission issue.

1 Comment

thank you, my permission and receiver seems to be ok, because i get notifications from parse panel

Your Answer

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.