parse.com - Parse Push's not delivered cloud code only -
i'm running parse-server on ubuntu , can't seem push notifications working when sent in cloud code.
push's work when using rest api call (passing master key) don't work when cloud code calls them.
what's interesting cloud code parse.push() method returns success , no error message.
my hypothesis configuration problem, , parse.push() method referencing somethign have incorrectly configured on server.
here cloud function. call works when sent via rest. , success callback in cloud called.
parse.push.send( { // where: pushqueryclient, channels: ["user_tkp7gurgzc"], data: { alert: pushtextclient } }, { success:function(){ console.log("push sent"); }, error: function(error){ console.log("push failed"); console.dir(error); }, usemasterkey: true});
i think have issue usemasterkey parameter. please try use code in order send push notification:
parse.push.send({ where: wherequery, data: { alert: { title: request.params.title, body: request.params.body }, type: request.params.type, sound: 'default' } }, { usemasterkey: true }).then(function() { response.success(); }, function(error) { response.error("push failed " + error); });
in code use promises best practice , wrap usemasterkey in separate object
Comments
Post a Comment