Skip to main content

Notifications

Dynamics 365 general forum
Unanswered

CIF listeners not firing

Posted on by 20

Hi,

I am writing some code for the channel integration framework, using a softphone. The Microsoft.CIFramework.searchAndOpenRecords functions are working fine, but I can't seem to get the even handlers working, e.g. click to act and onpagenavigate.

This is the code I am using to start the handlers, but the listener is not starting at all. The initCTI is being written to the log, but nothing else happens. Any help would be appreciated. I am calling the function after the softphone has finished loading.

// JavaScript source code
export function pageNavigateHandler(eventData) {

console.log("eventFired")
console.log(eventData)
return Promise.resolve();
}

export default function initCTI() {
console.log("initCTI");

(function () {
window.addEventListener("CIFInitDone", function () {

console.log("handler startedtest");
Microsoft.CIFramework.addHandler("onpagenavigate", pageNavigateHandler);
console.log("Added handlers for the panel");
//Code that consumes CIF library APIs.
});
})();

}

  • Suggested answer
    abhi5459 Profile Picture
    abhi5459 2 on at
    CIF listeners not firing
    I tried the same thing and found out the issue. The CIFInitDone event is triggered before the web resource's code is loaded. It means that the code which is adding the event listener for CIFInitDone is loaded after the event is triggered from dynamics CIF library, so the event is never captured at all.
     
    Hopefully this will be fixed soon by ms dynamics team. In the meantime, I think we can assume that it is initialised before web resource is loaded.

Helpful resources

Quick Links

Dynamics 365 Community Update

Welcome to the inaugural Community Platform Update. As part of our commitment to…

Dynamics 365 Community Newsletter - August 2024

Catch up on the latest D365 Community news

Community Spotlight of the Month

Kudos to Mohana Yadav!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,115 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 227,971 Super User 2024 Season 2

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans