Trying to load Open CTI library in #LWC. Getting warning "Evaluation error [Failed to initialize Open CTI. Ensure that it is loaded from the right frame with correct URL parameters]" Am I missing anything?
step1: Load open CTI library into static resource from https://domain:port/support/api/49.0/lightning/opencti_min.js
step2: Try to load the static resource in LWC component -
connectedCallback() {
Promise.all([
loadScript(this, OpenCTIResource + '/opencti_min.js')
]).then(() => {
console.log('ConnectedCallBack.. script loaded..!!');
sforce.opencti.getAppViewInfo({callback: appViewInfoCallback});
}).catch(error => {
console.log('Error msg : ', error);
});
}
Note - I can see the OpenCTI file is loaded under resources of chrome debugger, but simultaneously getting warning saying - "Evaluation error [Failed to initialize Open CTI. Ensure that it is loaded from the right frame with correct URL parameters]"
Please suggest.