Initialize CWIC Library
Before using any of the features provided via CWIC, CWIC Library needs to be initialized. CWIC library is initialized
through System Controller method.
// Calling API to initialize cwic library.
cwic.SystemController.initialize();
Initialization process is asynchronous process. In order to know when CWIC library is fully initialized
event handler for "onInitialized" event must be set, before calling
initialize.
// Our event handler function for 'onInitialized'
function onCwicInitialized()
{
// Rest of the API can now be called...
}
// Registration of event handler.
cwic.SystemController.addEventHandler('onInitialized', onCwicInitialized);
cwic.SystemController.initialize();
Handle Initialization Errors
Initialization of CWIC library is complex process. It consists of initializing CWIC components, browser specific
plugin (Extension for Google Chrome, NPAPI for Firefox and Safari and ActiveX for Internet Explorer) and Add-on.
Initialization of plugin component can fail and in order to track that failure event handler
for onInitializationError must be set, before calling
initialize.
// Our event handler function for 'onInitializationError'
function onCwicInitializationError(error)
{
// Error handling ...
}
// Registration of event handler.
cwic.SystemController.addEventHandler('onInitializationError', onCwicInitializationError);
cwic.SystemController.initialize();