Most of the times when I try to make a Push, none is beign sent. "Pushes sent" field in Push console tab displays 0. Despite that there are installations matching the query. When I uncomment this few lines below, installation is being returned successfully.
When trying to send Push manually via panel, when setting audience parameters, correct number of recipients is being displayed. After sending, once again "Pushes sent" displays ZERO.
Installations have deviceTokens [iOS]. That's my cloud code:
var installationQuery = new Parse.Query(Parse.Installation);
var inUserQuery = new Parse.Query(PKUser);
inUserQuery.equalTo("objectId", toUserID);
installationQuery.matchesQuery("user", inUserQuery);
// installationQuery.find({
// success: function(iresults) {
// console.log("inst results");
// console.log(iresults);
// }, error: function(err) {
// console.log("inst error");
// console.log(err);
// }
// });
// sending a push
Parse.Push.send({
where: installationQuery,
data: {
"alert": user.get("firstName")+": "+shortenedMessage,
"badge": "Increment",
"content-available": 1,
"text": message,
"from": user.id,
"id": object.id
}
}, { success: function() {
response.success("ok");
}, error: function(err) {
response.error("push");
}
});