Namespace: Signage

Custom# Signage

Dependence APIs about signage.
Version:
  • 1.0

Methods


addUSBAttachEventListener(successCallback, failureCallback)

Add event listener that get USB/SDCard list whenever external storage device is attached/detached.
Parameters:
Name Type Description
successCallback function Callback function if addUSBAttachEventListener() is called successfully.
If its callback is called, you can handle argument object with following properties:
Properties
Name Type Description
deviceList object Connected USB storage device list.
failureCallback function Callback function when error is occurred during addUSBAttachEventListener() is called.
If its callback is called, you can handle argument object with following properties:
Properties
Name Type Description
errorCode string Error code.
errorText string Error text.
Version:
  • 1.3180710
Since:
  • webOS Signage 2.0
Example

Below example will get external storage list.

// Add event listener.
var custom = new Custom();
custom.Signage.addUSBAttachEventListener(
    // successCallback is called whenever external storage device is attached/detached.
    function successCallback(successObject) {
        for(var i=0; i<successObject.deviceList.length; i++) {
            var device = successObject.deviceList[i];
            console.log('Device Type   : ' + device.type);
            console.log('Device Vendor : ' + device.vendor);
            console.log('Device Name   : ' + device.device);
        }
    },
    function failureCallback(failureObject) {
        console.error('[' + failureObject.errorCode + '] ' + failureObject.errorText);
    }
);

disableApplication(successCallback, failureCallback, parameters)

Disable SI application after rebooting. It will set application launch mode to NONE. If 'reset' property set to true, all SI server settings will be reset.
Parameters:
Name Type Description
successCallback function Callback function if disableApplication() is called successfully without any argument object.
failureCallback function Callback function when error is occurred during disableApplication() is called.
If its callback is called, you can handle argument object with following properties:
Properties
Name Type Description
errorCode string Error code.
errorText string Error text.
parameters object
Properties
Name Type Argument Default Description
reset string <optional>
false If its value is true, all SI Server settings value will be reset. Default value is false.
Version:
  • 1.0161215
Since:
  • webOS Signage 1.0
Example

Below example will disable application after rebooting.

// Disable SI application, and reset all SI Server settings.
var custom = new Custom();
custom.Signage.disableApplication(
    function successCallback() {
        console.log('After rebooting, application is not launched.');
    },
    function failureCallback(failureObject) {
        console.error('[' + failureObject.errorCode + '] ' + failureObject.errorText);
    },
    {
        reset : true
    }
);

enableScreenShareApp(successCallback, failureCallback, parameters)

Enable of disable Screen Share application can be run through webOS Signage UX. Screen Share application can be launched via Custom.Signage.switchApplication() even if disabled by this API.
Parameters:
Name Type Description
successCallback function Callback function if enableScreenShareApp() is called successfully without any argument object.
failureCallback function Callback function when error is occurred during enableScreenShareApp() is called.
If its callback is called, you can handle argument object with following properties:
Properties
Name Type Description
errorCode string Error code.
errorText string Error text.
parameters Object
Properties
Name Type Description
enable boolean If this value is true, Screen Share application can be run through UX. If false, Screen Share application is disappear.
Version:
  • 1.3190510
Since:
  • webOS Signage 3.2
Example

Below example will disable Screen Share application.

// Disable Screen Share application.
var custom = new Custom();
custom.Signage.enableScreenShareApp(
    function successCallback() {
        console.log('Screen Share application is disabled.');
    },
    function failureCallback(failureObject) {
        console.error('[' + failureObject.errorCode + '] ' + failureObject.errorText);
    },
    {
        enable: false
    }
);

getApplicationInfo(successCallback, failureCallback)

Gets IPK type application information from appinfo.json. If current application type is not IPK type, failureCallback will be called. This function call successfully only if current location is application root.
Parameters:
Name Type Description
successCallback function Callback function if getApplicationInfo() is called successfully with a argument object from appinfo.json.
failureCallback function Callback function when error is occurred during getApplicationInfo() is called.
If its callback is called, you can handle argument object with following properties:
Properties
Name Type Description
errorCode string Error code.
errorText string Error text.
Version:
  • 1.0170120
Since:
  • webOS Signage 2.0
Example

Below example will get IPK application information from appinfo.json.

// Gets IPK type application information from appinfo.json.
var custom = new Custom();
custom.Signage.getApplicationInfo(
    function successCallback(successObject) {
        console.log('Data from appinfo.json : ' + JSON.stringify(successObject), null, 4);
    },
    function failureCallback(failureObject) {
        console.error('[' + failureObject.errorCode + '] ' + failureObject.errorText);
    }
);

getwebOSVersion(successCallback, failureCallback)

Gets webOS Signage version.
Parameters:
Name Type Description
successCallback function Callback function if getwebOSVersion() is called successfully.
If its callback is called, you can handle argument object with following properties:
Properties
Name Type Description
webOSVersion string webOS Signage version.
failureCallback function Callback function when error is occurred during getwebOSVersion() is called.
If its callback is called, you can handle argument object with following properties:
Properties
Name Type Description
errorCode string Error code.
errorText string Error text.
Version:
  • 1.0170328
Since:
  • webOS Signage 1.0
Example

Below example will get webOS Signage version.

// Gets webOS Signage version.
var custom = new Custom();
custom.Signage.getwebOSVersion(
    function successCallback(successObject) {
        console.log('webOS Signage version : ' + successObject.webOSVersion);
    },
    function failureCallback(failureObject) {
        console.error('[' + failureObject.errorCode + '] ' + failureObject.errorText);
    }
);

removeUSBAttachEventListener(successCallback, failureCallback)

Remove registered event listener that get USB/SDCard list whenever external storage device is attached/detached.
Parameters:
Name Type Description
successCallback function Callback function if removeUSBAttachEventListener() is called successfully without any argument object.
failureCallback function Callback function when error is occurred during removeUSBAttachEventListener() is called.
If its callback is called, you can handle argument object with following properties:
Properties
Name Type Description
errorCode string Error code.
errorText string Error text.
Version:
  • 1.3180710
Since:
  • webOS Signage 1.0
Example

Below example will remove USB attach event listener as already registered.

// Remove event listener.
var custom = new Custom();
custom.Signage.removeUSBAttachEventListener(
    function successCallback(successObject) {
        console.log('USB attach remove listener is removed.');
    },
    function failureCallback(failureObject) {
        console.error('[' + failureObject.errorCode + '] ' + failureObject.errorText);
    }
);

switchApplication(successCallback, failureCallback, parameters)

Switch current app to target application. You should installed target application, such as ZIP type or IPK type. See 'Custom.APPLICATION' constants for using this function.
Parameters:
Name Type Description
successCallback function Callback function if switchApplication() is called successfully without any argument object.
failureCallback function Callback function when error is occurred during switchApplication() is called.
If its callback is called, you can handle argument object with following properties:
Properties
Name Type Description
errorCode string Error code.
errorText string Error text.
parameters object
Properties
Name Type Description
application string Target application for you want to switch and launch
Version:
  • 1.0
Since:
  • webOS Signage 2.0
See:
Example

Below example will switch application to IPK application.

// Switch current app to target application.
var custom = new Custom();
custom.Signage.switchApplication(
    function successCallback() {
        console.log('This success callback does not work because new application will be launched.');
    },
    function failureCallback(failureObject) {
        console.error('[' + failureObject.errorCode + '] ' + failureObject.errorText);
    },
    {
        application : Custom.APPLICATION.IPK_TYPE
    }
);