Lifecycle events are not working

I tried implementing life cycle events for which I embedded my site in iframe. But couldn't able to see the onblur and onfocus events are firing whenever user moved from one tab to other tab or moves away from site.

Below is the syntax which I used.

      var ClientApp = window.purecloud.apps.ClientApp;
      var myclientApp = new window.purecloud.apps.ClientApp({ pcEnvironment: "mypurecloud.com" })
      const onFocus = async evt => { await alert("onFocus") }
      const onBlur = async evt => { await alert("onBlur") }
      myclientApp.lifecycle.addBlurListener(onBlur);
      myclientApp.lifecycle.addFocusListener(onFocus);

Can anyone help me what I am missing here.

The blur and focus events happen when the embedded app gains/loses focus within the page. I wouldn't expect events that happen outside of the page (like the user switching tabs) to cause events in the client.

Thanks for the response Smith. Even for with in the page also events are not working. I have shared the syntax above which I used in my embedded application. I just want to trigger an event when users moves away from apps to other modules in genesys.

Hello Smith,

Still I am waiting for your response. I tried to implement life cycle events to capture events whenever user moves to another module within genesys application but not luck. I have shared the syntax which I have used. Could you please help me ASAP.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.