I am integrating my call center widget application to dynamics 365 crm. I am using Channel integration framework(Microsoft.CIFramework).
I am registering handler for events such as onpagenavigate and onclicktoact as per documentation.
Microsoft.CIFramework.addHandler("onpagenavigate", handlerFunction).then(
function success(result) {
console.log(result);
},
function (error) {
console.log(error.message);
// handle error conditions
});
var handlerFunction = function(eventData) {
return new Promise(function (resolve, reject){
try{
console.log(eventData)
return resolve();
}catch(error){
return reject();
}
})
}
But my handler function is not getting invoked.
I could see the error in console one any page navigation.
I debugged the library code, i could find error on addhandler registration.
Please help me what i am missing here.
I have resolved this issue with the simple configuration.
While configuring the channel integration framework provider, you need to give the domain where the events need to be posted by dynamics in trusted domain field.
I have given my app domain in the trusted domain field and registered the addhandler for opagenavigate in my app.