Cordova SDK Reference

Interface cordova/exec

Represents the JavaScript interface to communicate with native SDK.

For obtaining the instance declare the following:

declare var cordova: any;
var exec = cordova.require("cordova/exec");  // this line for Cordova only

Lambda function function(dataset) {}

A success callback function. Assuming your exec call completes successfully, and the param is the collected dataset

Lambda functionfunction(error) {}

An error callback function. If the operation does not complete successfully, this function executes with an optional error parameter.

"service"

The service name to call on the native side. This corresponds to a native class, for which more information is available in the native guides listed below. (The value must be - CredoAppSdk)

"action"

The action name to call on the native side. This generally corresponds to the native class method. See the native guides listed below. (The value must be - execute)

Returns:

TypeDescription
StringReturns JSON dataset in compressed string format if collect action is succeeded

Error Codes

Status CodeReasonDescription
30Duplicated areas errorThe extracting areas are duplicated.
90Unknown errorAn unexpected error occurred.