|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Objectcom.parse.ParseCloud
public final class ParseCloud
The ParseCloud class defines provides methods for interacting with Parse Cloud Functions. A Cloud
Function can be called with ParseCloud.callFunctionInBackground(String, Map, FunctionCallback)
using a FunctionCallback
. For example, this sample code calls the "validateGame" Cloud
Function and calls processResponse if the call succeeded and handleError if it failed.
ParseCloud.callFunctionInBackground("validateGame", parameters, new FunctionCallbackUsing the callback methods is usually preferred because the network operation will not block the calling thread. However, in some cases it may be easier to use the
ParseCloud.callFunction(String, Map)
call which do block the calling thread. For example, if your
application has already spawned a background task to perform work, that background task could use
the blocking calls and avoid the code complexity of callbacks.
Method Summary | ||
---|---|---|
static
|
callFunction(String name,
Map<String,?> params)
Calls a cloud function. |
|
static
|
callFunctionInBackground(String name,
Map<String,?> params)
Calls a cloud function in the background. |
|
static
|
callFunctionInBackground(String name,
Map<String,?> params,
FunctionCallback<T> callback)
Calls a cloud function in the background. |
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static <T> bolts.Task<T> callFunctionInBackground(String name, Map<String,?> params)
name
- The cloud function to call.params
- The parameters to send to the cloud function. This map can contain anything that could
be placed in a ParseObject except for ParseObjects themselves.
public static <T> T callFunction(String name, Map<String,?> params) throws ParseException
name
- The cloud function to call.params
- The parameters to send to the cloud function. This map can contain anything that could
be placed in a ParseObject except for ParseObjects themselves.
String
, ?>,
ParseObject
, List
<?>, or any type that can be set as a field in a
ParseObject.
ParseException
public static <T> void callFunctionInBackground(String name, Map<String,?> params, FunctionCallback<T> callback)
name
- The cloud function to call.params
- The parameters to send to the cloud function. This map can contain anything that could
be placed in a ParseObject except for ParseObjects themselves.callback
- The callback that will be called when the cloud function has returned.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |