I'm trying to implement Messenger deployment in our demo environment in order to make a PoC for cusotmers, but I'm havin issuen when I try to implement it.
Before calling a Messenger command, please subscribe to its ready event and then call Messenger.open inside it. Calling it early can result in this way because the plugin is not yet registered and still loading.
In our developer docs, please see the "Note" at the very top and example code. Let us know if this is helping.
I've done it, but the code never subscribe to the event. I guess something is missing. Do you have a basic HTML code that works so that I can adapt it to our organization and test it?
Here is a sample running code that I put in jsfiddle - Edit fiddle - JSFiddle - Code Playground. Take a look at this. I added a custom button "Open Messenger" simulating your code that opens Messenger when you click on it.
One item to mention: From your snippet above, I see deploymentId: 'deploymentId', - I assume you hidden the actual value here so it is not visible here in public, but just to mention it must be the actual value of your deployment. About how to create deployment, you can refer to this article - Deploy Messenger - Genesys Cloud Resource Center.
If you are still not able to get this running, please provide us access to your code or any sample running code I can take a quick look.
Thank you for your help, If I change the deploymentID and the environment in your jsfiddle code, it works perfectly. However, when I implement it in my files, the trace "Messenger wait why Messenger is initializing and try again." is always appearing.
I've two files, EjemploMessenger_DescargadoDeveloper.html with code:
I couldn't see EjemploMessenger_DescargadoDeveloper.js file being fetched at all when I opened EjemploMessenger_DescargadoDeveloper.html in the browser. When I inspected the network logs, it doesn't show your .js file being fetched at all. Is this a live example that you are trying to show? If so, you need to make sure that this js file is loaded and executed on page load. This will initialize the Messenger and have it ready for you to accept running the command. Now, when you click on "Open Messenger" button that calls the Messenger.open command which opens Messenger.
If you are still running into issues, I would recommend to work the care team who can work with you and help you in setting it up.
Hello, we have published the html under one of our domains and it works. It only fails when I run the code locally. Is there any limitation in this way?