Backendless Version (Pro)
Client SDK (Android/ CloudCode)
Application ID = DD9FC30D-3A6F-AB4C-FF9C-24DC92E73100
Expected Behavior
We have created backend API’s using the Cloud Code service and want to use the SDK created from this to pull data into our Android app. After creating a CloudCode API to pull in all the objects from our data table, we downloaded the SDK and started to right the code to properly invoke it.
We have followed the invoking example that is given with the SDK, when going to invoke the function, we put the 4 parameters that our Async API is expecting so that the value can be returned. The code then asks for a fifth parameter ‘callback’, we are unable to figure out what parameter needs to be passed here so that we can have the correct JSON object returned.
I included the example below, as well as the async code that we have been using. Please advise.
Code from cloud code SDK that we are trying to invoke
public static void getAllChurchesAsync(int limit, int offset, java.lang.String q, int build, AsyncCallback<com.ns804.hereiam.churches> callback)
{
Object[] args = new Object[]{limit, offset, q, build};
Backendless.CustomService.invoke( SERVICE_NAME, "getAllChurches", args, callback);
}
Code that we created in Kotlin to invoke this method
object InvocationExample {
@JvmStatic
fun main(args: Array<String>) {
ChurchService.initApplication()
ChurchService.getInstance()
// invoke methods of you service
val result: Any = ChurchService.getAllChurchesAsync(limit, offset, q, 0, AsyncCallback<churches> )
println( result );
}
}
AsyncCallback<churches is the placeholder that we are using for the callback parameter, but it has not been working.
Thanks.