Questions about genesys global function APIs

I am creating a UI from scratch and uses the Genesys global function APIs.
I have few questions and hope to give light:

  1. May I know when to use MessagingService.startConversation and when not to?
    After adding the script, the current setup suffices and even MessagingService.started.
    What are the use cases for this function?

  2. We have problems with iOS Safari not starting the conversation. And it is hard to debug because it is not giving any error logs. May I know what might be the problem for this?

  3. Also I believe when you open the chat in iOS Safari in iPhone then put it into background and open a different application, the websocket will be closed. What events should I listen to and what commands do I need to restore into the previous running state?

Hi @IvanDg

  1. You can call MessagingService.startConversation initially once to start a conversation, once started you don't need to call this command again. This will open the Web Socket connection for you to start sending messages. On all subsequent page reloads and page navigations the conversation is restored automatically. There is MessagingService.started event published. Its just a way to inform that it has successfully started, in this way you can indicate that in the UI if you want and set a local boolean flag that you can check later again before calling this command again.

  2. You can check your network logs in Safari browser connecting your iPhone to Mac via cable and check if Web Socket connection is established. wss://webmessaging..com/v1?deploymentId=xxxxx. How to debug phone with Mac - How to Activate the iPhone Debug Console or Web Inspector. There is also
    MessagingService.error event published that you can check for.

  3. There is no event published when browser goes background/foreground. It is something you will have to write code using visibility change event, then call MessagingService.reconnect command, it will makes a restore request and reconnects to the same session.

Okay thank you for your response!

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