openFrameAPI - init(Object config, function successCallback, function failureCallback)

Initialize OpenFrame, must be the first method called.

This method initializes communication to TopFrame and initializes any visual elements passed in the config parameter.

Table 1. Parameters
Name Type Description
config Object An object of key value pairs. The possible keys are height, width, title, subTitle, and titleIcon. All keys are optional.
successCallback function The callback function used if the init method succeeds. The openframe configuration stored in the system is passed as a parameter to the callback function.
failureCallback function The callback function used if the init method fails.
Table 2. Returns
Type Description
void

var config = {
height: 300,
width: 200
}
function handleCommunicationEvent(context) {
console.log("Communication from Topframe", context);
}
function initSuccess(snConfig) {
console.log("openframe configuration",snConfig);
//register for communication event from TopFrame
openFrameAPI.subscribe(openFrameAPI.EVENTS.COMMUNICATION_EVENT,
handleCommunicationEvent);
}
function initFailure(error) {
console.log("OpenFrame init failed..", error);
}
openFrameAPI.init(config, initSuccess, initFailure);