Use the provided ExampleWizard.zip and other sample wizards included with Signatus as a reference when building your own wizard.
Most JavaScript functions in the Wizard SDK accept their input as a JSON object, unless stated otherwise. Instructions for including the SDK library in your wizard are described in the previous section. Required JSON keys are marked with an asterisk (*).
Wizards are supported in the Android, Windows, and iOS versions of the Signatus native application. Not every API call is available on every platform—platform support is listed in the heading of each API call.
As wizard support was extended to Windows and iOS, the SDK was updated to support asynchronous execution in addition to synchronous calls.
Synchronous-to-asynchronous wrapper for Windows and iOS compatibility #
Some SDK functions are synchronous and return a result immediately. Because synchronous calls are not supported on Windows, the SDK provides the optional call parameter. When call is specified, the function behaves asynchronously and returns the result via the named callback function. The callback receives a JSON result object.
#
Example using getInfo:
- Synchronous call:
let info = getInfo({"code":"Version"});
// info = 3.15.17- Asynchronous call:
getInfo({"code":"Version","call":"onVersion"})
function onVersion (res) {
let resul = JSON.parse(res);
}This triggers the callback function onVersion passing result
{
"parameter": {
"status": "OK",
"message": "",
"data": "3.15.7"
}
}Pass-through Parameters #
The SDK javascript function accepts an optional object named parameter .This object acts as a transparent data carrier (metadata). Any properties defined within this object are preserved and returned back to the specified callback function upon completion.
Usage Pattern #
This is particularly useful for UI state management, such as identifying which input field triggered the recognition when multiple fields share the same callback handler.
Example :
const arg = {
"parameter": {
"inputid" : "text1"
},
"call" : "onRecognition"
};
startSpeechRecognition(arg);
/**
* callback function for startSpeechRecognitionfunction
* @param res - result in string format
*/
function onRecognition(res) {
const result = JSON.parse(res);
$("#"+result.inputid).val(result.parameter);
// where
// result.inputid = returned from parameter argument
// result.parameter = value of recognized text from speech recognition
}Result example :
{
"inputid": "text1",
"parameter": "Recognized input value"
}