Download full document:

Global

Type Definitions

connectionParams

Configuration options to create the session.

Type

  • Object

Properties

NameTypeDescription
connectionParams Object
Properties
NameTypeAttributesDescription
launchType String <optional> Takes "message" or "embed" as value. Defaults to "message".

"message" - launches the session in a new window (similar to session launch using Receiver for Chrome).
"embed" - Embeds the session inside third party Chrome app.
container Object <optional> Appview element created inside third party Chrome app.

Applicable only when launchType is "embed".
bounds Object <optional> Sets a fixed width and height to the session.
Properties
NameTypeDescription
autoresize boolean Should be set to false to give fixed width and height to session. By default, this value is set to true in which case the session is resized to match the size of appView element inside third party Chrome app or the new window.
width Number Width of the session specified in pixels. This value will be set only when autoresize is set to false.
height Number Height of the session specified in pixels. This value will be set only when autoresize is set to false.
preferredLang String <optional> Specifies the preferred language code to be used inside the session. If the language code specified is either invalid or unsupported then it falls back to "en".

Supported language codes : en, de, es, fr, ja, ko, ru, zh, zh-cn, zh-tw.

If the value is unspecified then the browser"s language code is used.

Example

connectionParams full example:

    var appView = document.createElement("appview");

    var connectionParams = {
        "launchType" : "embed",
        "container": appView,
        "bounds" :{
            "autoresize":false,
            "width": "800",
            "height":"600"
        },
        "preferredLang" : "ja" //Setting to Japanese
    }

eventListener (event)

Listener to handle the events.

Parameters

Name Type Description
event Object Object as appropriate to the eventType registered.

Properties

Name Type Description
event.id String ID of the session object
evebt.type String Event type triggered
event.data Object Data as appropriate to the event triggered

- onConnection
- onConnectionClosed
- onURLRedirection
- onError

onSessionCreated(sessionObject)

Callback having the session object created.

Parameters

Name Type Description
sessionObject Session Session object to interact with the session like register and handle events, start and disconnect.

Example

function sessionCreated(sessionObject) {
//Handle session interactions like events, start, disconnect here.
//ICADATA has been constructed for example. Recommending to use StoreFront/WebInterface SDK to get ICA.
//Refer session.start() for more details.
    var icaData = {
        "Domain":"abcd",
        "ClearPassword":"xxxxxxxxx",
        "InitialProgram":"#Desktop",
        "Title":"Desktop",
        "Address":"xx.xx.xx.xx",
        "Username":"xyz"
    };
    var launchData = {"type" :"json",value :icaData};

    function sessionResponseCallback(response) {
        console.log("start", response);
    }

    sessionObject.start(launchData,sessionResponseCallback);
}

responseCallback(response)

Callback that handles the response.

Parameters

Name Type Description
response Object Response object

Properties

Name Type Description
response.success boolean Status of the method call. Holds the value true in case of success and false in case of failure. In case of failure, details of the error is set in the response object.
response.sessionId String Id of the session.
response.error String Reason for the failure of the method call.