How To Retrieve List Of Parseusers In Push Notification Using Parse In Android App
We are new to push notification concept,we have installed our App into three mobiles & names are registered in parse server names like tab,sam,sony. Now we need to get three na
Solution 1:
Now I understand your question. So, you want to query the Parse Installation table and retrieve the user column values. You can achieve this via writing a cloud function where you have to user Parse.Installation query. For example below code query the Installation table and retrieve all of user column values;
Parse.Cloud.define("getUsers", function(request, response)
{
Parse.Cloud.useMasterKey();
var query = new Parse.Query(Parse.Installation);
var usernameList = "";
query.find({
success: function(results){
for (var i = 0; i < results.length; i++)
{
usernameList += results[i].get('user')+"~";
}
response.success(usernameList);
},
error: function(error) {
//error
console.log("error: " + error);
response.error(error);
}
});
});
You can write this cloud function to your Parse cloud and you can trigger this function from your android application. The above code will produce the users name with ~ separated. You can look the Parse tutorials to dig into Cloud function and how to trigger cloud function from your android application. Hope this helps.
Regards.
Post a Comment for "How To Retrieve List Of Parseusers In Push Notification Using Parse In Android App"