Web Messaging - Messenger.ready event

Hello,

I am subscribing to the Messenger.ready event, and running the Mesenger.open command after I receive that event.

Genesys("subscribe", "Messenger.ready", function(o){
  console.log("Messenger Ready Event"); 
        Genesys("command", "Messenger.open");

My expected behavior would be to have the Messenger window auto-pop for the user with the few lines of code above. This is not working as expected, and the Messenger window is staying minimized.

Any thoughts or suggestions on how to auto-pop Messenger interface?

Hi :wave: - Good catch, we managed to reproduce this and will fix soon. In meantime you can use a variation of that logic with this script (relying on Launcher.ready event):

Genesys("subscribe", "Launcher.ready", function(o){ console.log("Launcher Ready Event"); Genesys("command", "Messenger.open");

Thanks, Angelo!

One other thing that we noticed... we are subscribing to the Messenger.open event, and then writing a few messages to the console log. We ran into an error that is depicted in the screen shot below

Genesys("subscribe", "Messenger.opened", function(o){
console.log("Messenger: opended event");
console.log("Messenger: Try to close messenger");
Genesys("command", "Messenger.close");

});

we are receiving the "messenger open event", trying to close it, then receiving an error message that the window is already closed.. Seems like the timing of the events firing are off here?

image

Hi, I'm unable to reproduce the issue you are seeing. In our testing, this script runs fine as-is with out any errors. The order of events is first "opened" followed by "closed". This error usually occurs only when Messenger is already closed and you are trying to close again.

A better way would be to enable debug mode when adding the single snippet and you can see all the events and its order published in the console - https://developer.genesys.cloud/commdigital/digital/webmessaging/messengersdk/genesysgf#enable-console-logging

Can you please check if you see any Messenger.closed event published earlier before trying to call Messenger.close?

I assume you currently have it this way:

Genesys('subscribe', 'Launcher.ready', function() {
    Genesys("command", "Messenger.open");
});

Genesys('subscribe', 'Messenger.opened', function() {
console.log("Messenger: opended event");
console.log("Messenger: Try to close messenger");
Genesys("command", "Messenger.close");
});

This should immediately close Messenger when it opens with out any console errors.

Hey Angelo,

Any update on this one?

Thanks,
Peter

Hello - the first issue you raised has been fixed, events should be fired properly now.
As for the second issue, I believe @Ranjith_Manikante_Sa asked for additional information: were you able to try the suggested approach?

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