The Device Features section provides access to native device capabilities.
It includes functions for using the camera, speech recognition, and QR code scanning.
These features enable interaction with device hardware and sensors directly from the application.
note (Android) #
Enables the creation of handwritten notes or drawings during wizard execution. Up to four pages of notes or drawings can be created.
Notes are initially saved in a proprietary SPD format and stored on the device as PNG images in the specified folder. If a PDF output is required, the jpgToPdf function can be used to convert the images into a PDF document.
/**
* @param {Object} arg- Parameter JSON object.
* @returns {void}
*/
function note(arg);Parameters description :
| Name | Required | Format | Description |
|---|---|---|---|
| savePath | true | string | Name of the folder within workspace directory to store created notes in a png format. It is a folder as there can be up to 4 notes created |
| srcFilePath | false | string | Path to a spd file within workspace directory |
| call | true | string | Callback function name |
| color | false | string | Set the color of the action bar at the top of the screen in hex format. For example “#ff0000“ |
| nativeMenu | false | string | native action bar button configuration. Are described in the Native menu chapter |
Example :
const arg = {
"savePath" : "/tosign",
"srcFilePath" : "/tosign/note.spd",
"call" : "onNote"
}
note(arg);
/**
* callback function for note function
* @param res - result in string format
*/
function onNote(res) {
const result = JSON.parse(res);
}Result example :
{
"parameter": {
"status": "ok"
}
}– Native menu #
Example :
"nativeMenu": [
{
"id": "action_ok",
"title": "Save note",
"icon": "REMOVE",
"color": "#01579b"
},
{
"id": "action_pen",
"title": "Pen",
"icon": "/img/pen.png",
"color": "#ff0000"
}
]Description :
| Name | Format | Description |
|---|---|---|
| nativeMenu | JSON Array | Native action bar button configuration |
| nativeMenu.id | string | Action bar button id. Allowed values : ā action_ok ā action_pen ā action_eraser |
| nativeMenu.title | string | Button label |
| nativeMenu.icon | string | Button icon. Allowed values : – REMOVE : no icon will be displayed – path to the icon file within the workspace |
| nativeMenu.color | string | Button label color in hex format |
scan (Android) #
Calls the Camera activity and when the image capture is complete, the image is saved as a JPEG file in the specified folder. If a callback function is defined, it is called when the scanning is finished.
/**
* @param {Object} arg- Parameter JSON object.
* @returns {void}
*/
function scan(arg);Parameters description :
| Name | Required | Format | Description |
|---|---|---|---|
| folder | true | string | Name of the folder within workspace directory to store captured image |
| file | false | string | Name of file to store the scanned image. If not specified image is captured with file name {timestamp}.jpg |
| call | true | string | Callback function name |
Example :
const arg = {
"folder" : "/img",
"file" : "Capture1.jpg",
"call" : "onScan"
}
scan(arg);
**
* callback function for scan function
* @param res - result in string format
*/
function onScan(res) {
const result = JSON.parse(res);
}Result example :
{
"parameter": "img/Capture1.jpg"
}startSpeechRecognition(Android, iOS) #
Launches the speech recognition and, once completed, invokes a JavaScript callback function with the captured voice data.
/**
* @param {Object} arg- Parameter JSON object.
* @returns {void}
*/
function startSpeechRecognition(arg);Parameters description :
| Name | Required | Format | Description |
|---|---|---|---|
| call | true | string | Callback function name |
Example :
const arg = {
"call" : "onRecognition"
};
startSpeechRecognition(arg);
/**
* callback function for startSpeechRecognitionfunction
* @param res - result in string format
*/
function onRecognition(res) {
const result = JSON.parse(res);
}Result example :
{
"parameter": "Recognized input value"
}getQRcode (Android, iOS) #
Launches the barcode scanning activity and, once completed, invokes a JavaScript callback function with the scanned result data.
/**
* @param {Object} arg- Parameter JSON object.
* @returns {void}
*/
function getQRcode(arg);Parameters description :
| Name | Required | Format | Description |
|---|---|---|---|
| call | true | string | Callback function name |
Example :
const arg = {
"call" : "onQrCode"
}
getQRcode(arg);
/**
* callback function for getQRcode function
* @param res - result in string format
*/
function onQrCode(res) {
const result = JSON.parse(res);
}Result example :
{
"parameter": "QR code value"
}email (Android) #
Opens the Android system email chooser, allowing the user to select an email client. The selected client is launched with the email fields prefilled, including To, CC, BCC, subject, and message body.
/**
* @param {Object} arg- Parameter JSON object.
* @returns {void}
*/
function email(arg);Parameters description :
| Name | Required | Format | Description |
|---|---|---|---|
| true | JSON Array | Array of email address | |
| subject | true | string | Email subject |
| text | true | string | Email body |
| file | true | string | Path to the PDF file to be send within the workspace. |
| cc | false | JSON Array | Array of email address |
| bcc | false | JSON Array | Array of email address |
Example :
const arg = {
"email": [
"john.smith@company.com"
],
"subject": "Test email subject",
"text": "Test email body",
"file" : "/signed/Test1.pdf",
"cc": [
"john.doe@company.com"
],
"bcc": [
"thomas.deer@company.com"
]
}
email(arg);openWeb (Android) #
Enables to display a web page in a wizard via embedded browser. It is possible to use the information available online and display within the wizard and combine with the process of the wizard or information available in the wizard.
Besides displaying the web content, it is possible to download a file available on web. After the user selects a file to download, the control will return to the wizard to process the file.
/**
* @param {Object} arg- Parameter JSON object.
* @returns {void}
*/
function openWeb(arg);Parameters description :
| Name | Required | Format | Description |
|---|---|---|---|
| url | true | string | URL of the web page to view |
| call | true | string | Callback function name |
| sso | false | boolean | If true, requests to authenticate (Microsoft NTLM) from the web site will be served transparently using stored username and password (see saveAuthentication), default is false |
| logOutUrl | false | string | If sso is true, logout url defined can be used to log out current user (logOutUrl=”logout.ashx”) |
| keepCookies | false | boolean | if true, cookies from the server will be kept for the subsequent openWeb invocations, default is false |
| keepAuth | false | boolean | If true, authentication from the server will be kept for the subsequent openWeb invocations, default is false |
| showProgress | false | boolean | If true, a progress animation will be shown until the web page is fully loaded, default is true |
| savePath | false | string | Directory to save the downloaded files |
| color | false | string | Set the color of the action bar at the top of the screen in hex format. For example “#ff0000“ |
| nativeMenu | false | string | NativeĀ action bar button configuration. Are described in the Native menu chapter |
Example :
const arg = {
"url" : "https://www.signatus.com",
"savePath" : "/tosign",
"color" : "#2757F5",
"call" : "onOpenWeb"
}
openWeb (arg);
/**
* callback function for openWeb function
* @param res - result in string format
*/
function onOpenWeb(res) {
const result = JSON.parse(res);
}Result example :
{
"parameter": {
"status": "CANCEL",
"message": "",
"data": "",
"code": 200
}
}openCustomTabs (Android) #
Enables to display a web page in a wizard via Chrome Custom Tabs.
/**
* @param {Object} arg- Parameter JSON object.
* @returns {void}
*/
function openCustomTabs(arg);Parameters description :
| Name | Required | Format | Description |
|---|---|---|---|
| url | true | string | URL of the web page to view |
| color | false | string | Set the color of the action bar at the top of the screen in hex format. For example “#ff0000“ |
Example :
const arg = {
"url" : "https://www.signatus.com",
"color" : "#2757F5"
}
openCustomTabs(arg);
