c# - ParsePush throws Exception 400 in Unity -
i have written function send push notification request server. using unity parse. when send request parse.parseexception: 400: bad request.
the idea send notification 1 player letting them know have been attacked player. can see i've done wrong?
debug.log ("<color=#ffa500ff> sending push notification </color>"); string pushmsg = "you attacked " + serverdata.instance.my_player.username; if(!serverdata.instance.pvp.pvpopponentdata.attackerwon) pushmsg += " , lost fight."; else pushmsg += " , won fight!"; debug.log(pushmsg); parsepush push = new parsepush(); push.query = parseinstallation.query.whereequalto("player",parseobject.createwithoutdata("player",serverdata.instance.pvp.pvpopponentdata.targetobjectid)); push.data = new dictionary<string, object> { {"title", serverdata.instance.pvp.pvpopponentdata.bragmessage}, {"alert", pushmsg} }; push.sendasync().continuewith(p => { if(sutil.isnotparseerror(p)) { debug.log ("<color=#ffa500ff> push notification sent! </color>"); } else { debug.log ("<color=#ffa500ff> push notification failed!\n" + p.exception.message + "</color>"); } });
Comments
Post a Comment