Skip to content

Instantly share code, notes, and snippets.

@manuel14 manuel14/getTeam
Created Oct 16, 2015

Embed
What would you like to do?
//esto es en android en la welcomeActivity
String userId = currentUser.getObjectId();
final HashMap<String, Object> params = new HashMap<>();
params.put("id", userId);
ParseCloud.callFunctionInBackground("getTeam", params, new FunctionCallback<ParseObject>() {
public void done(ParseObject o, ParseException e) {
if (e == null) {
Toast.makeText(getApplicationContext(),
"Tiene equipo",
Toast.LENGTH_LONG).show();
} else {
Toast.makeText(getApplicationContext(),
e.toString(),
Toast.LENGTH_LONG).show();
}
}
});
//funcion definida en el cloud
Parse.Cloud.define("getTeam", function(request, response) {
var team = Parse.Object.extend("Team");
var query = new Parse.Query(team);
var id = request.params.id;
query.get(id , {
success: function(team) {
response.success(team);
},
error: function(request) {
response.error(id);
}
});
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.