Sto usando Parse e non riesco a far funzionare questo metodo.Parse Cloud: Invia Push a un singolo utente
L'idea è di inviare push a un singolo utente con un identificativo utente già noto da qualsiasi piattaforma all'interno di "codice Cloud".
query Ho provato senza spinta essere consegnati per l'utente (in realtà alcuna spinta è stato consegnato a tutti gli utenti)
PFInstallation attraverso il puntatore utente:
var targetUser = new Parse.User();
targetUser.id = userID;
var query = new Parse.Query(Parse.Installation);
query.equalTo('user', targetUser);
query in PFUser sé
var query = new Parse.Query(Parse.User);
query.equalTo('objectId', userID);
codice completo per il metodo:
Parse.Cloud.define("sendPushContactUser", function(request, response) {
// Get parameters
var userID = request.params.userID; // I'm obviously passing this parameter in the method call
// Query
/* ------ query = Any of the above options ------ */
Parse.Push.send({
where: query,
data: {
title : "New message",
alert : "User message",
badge : "Increment",
sound : "soundNotifUserContact.caf",
"params" : {
"pushType" : 2,
"userID" : userID
}
}
}, {
success: function() {
response.success();
},
error: function(error) {
response.error(error);
}
});
});
Grazie per il tuo tempo e il tuo aiuto.
come Chiamate il metodo cloud da Android ?? – Erum