Hi,
I wanted to follow up and share that I believe I’ve identified the root cause of my issue.
After taking a step back and reviewing the demo code more carefully, I realised I had misunderstood the distinction between the calling remote context and the window context.
In the demo code provided by HubSpot, events are sent to HubSpot using thirdPartyToHostEvents with
cti.contract.incomingCall
from the appropriate context. However, I had been incorrectly calling
cti.incomingCall
directly from the remote window context, which was preventing the events from properly reaching HubSpot.
What made this particularly confusing was I could see in the console Hubspot had received an incomingCall event from the app and the calling widget was still popping up in HubSpot despite this mistake, which led me to believe I was doing things correctly.
I’m still not entirely clear on why that partial functionality was working, but it explains why the event handlers weren’t firing as expected.
Apologies for the confusion on my end, and thanks for your patience in helping me work through this!
Hopefully that helps someone out in the future!