mercredi 1 avril 2015

Send push using cloud parse code for various targeting


Vote count:

0




I am using parse code cloud, to send a push after saving a race to see:



Parse.Cloud.afterSave("Race", function(request) {
var origemLocation= request.object.get('origeLocation');

var queryTaxistas = new Parse.Query("Taxista");
queryTaxistas.equalTo("ativo",true);
queryTaxistas.withinKilometers('location',origemLocation,3);


var pushQuery = new Parse.Query(Parse.Installation);
pushQuery.matchesQuery("user",queryTaxistas);

Parse.Push.send({
where: pushQuery,
data: {
alert: "Teste send"
}
}, {
success: function() {
console.log("sucess");
},
error: function(errorPush) {
console.log("erro ao enviar push"+errorPush.code+" : "+errorPush.message);
}
});
});


It would seem to me the error is in pushQuery when I take pushQuery.matchesQuery ("user", queryTaxistas) and add a query only for the channels it sends.



asked 22 secs ago







Send push using cloud parse code for various targeting

Aucun commentaire:

Enregistrer un commentaire