Monday, 15 June 2015

java - Send Parse Push notification with specific user -



java - Send Parse Push notification with specific user -

i'm programming android app share different content. develop social network, , when 1 user add together new friend, send parse force notification user add together you.

i utilize parse sdk, , don't how this.

i seek this:

parseinstallation installation = parseinstallation.getcurrentinstallation(); installation.put("userid",id); seek { installation.save();

this create userid column in installation class of parse data. (i see parse info , userid column right id user)

next do:

//create our installation query parsequery<parseinstallation> pushquery = parseinstallation.getquery(); pushquery.whereequalto("userid",parseuser.getcurrentuser().getobjectid()); // send force notification query parsepush force = new parsepush(); push.setquery(pushquery); // set our installation query push.setmessage("willie hayes injured own pop fly."); push.sendinbackground();

i create query compare userid colum (that contains userid user add together you) current parseuser, force don't send, , nobody receive.

please help me.

thanks.

what did registered device channel corresponding user. in swift did this, in android similar. means user "userid" subscribed channel "user_userid".

let currentinstallation = pfinstallation.currentinstallation() currentinstallation.channels = ["user_" + pfuser.currentuser().objectid] currentinstallation.saveinbackground()

then when want send push, send channel "user_userid".

java android push-notification parse.com cloud

No comments:

Post a Comment