ParseQuery<ParseInstallation> pushQuery = ParseInstallation.getQuery();
pushQuery.whereEqualTo("channels", "Done"); // Set the channel,Done is channel name
pushQuery.whereEqualTo("user","tab");//tab is user name
// Send push notification to query
ParsePush push1 = new ParsePush();
push1.setQuery(pushQuery); // Set our Installation query
push1.setMessage("Hello Mr "+pushmsg.getText().toString());
push1.sendInBackground();
答案 0 :(得分:0)
这是答案。试试这个。
ParseQuery<ParseInstallation> query = ParseInstallation.getQuery();
query.whereEqualTo("PhoneNumber", destNumber); //Checks whether the receiver has registered his phone number on parse.com. you need to store the users phone number while he installs the app.
JSONObject jSonobj;
try {
jSonobj = new JSONObject();
jSonobj.put("action", "com.thoughtrix.introduce.UPDATE_STATUS");
jSonobj.put("from", senderPhoneNumber);
jSonobj.put("name", infoName);
jSonobj.put("number", infoNumber);
jSonobj.put("title", "Introduce");
jSonobj.put("message", message);
ParsePush push = new ParsePush();
push.setQuery(query);
push.setData(jSonobj);
push.sendInBackground();
} catch (JSONException e) {
e.printStackTrace();
}