Hi there:
I am trying here to configure a Genesys Widget following documentation and specific section 'https://docs.genesys.com/Documentation/GWC/latest/WidgetsAPI/WebChatConfiguration' and also to have a Custom Formulary by using 'https://docs.genesys.com/Documentation/GWC/latest/WidgetsAPI/CustCRF'
However, none of the options described there seems to have effect when typed under my code. Only theme changes, but if we add a new form using a JSON string or try, in example, to disable emojis, it just does nothing and widget shown is the same.
Troubleshooting, I've noticed that namespace I am using is different to the ones in the example. I am using '[b]_genesys.cxwidget[/b]':
[code]
window._genesys.cxwidget = {
main: {
debug: true,
theme: "dark",
lang: "en",
plugins: [
"cx-webchat",
"cx-webchat-service"
]
},
webchat: {
dataURL: "http://MYIP:PORT/genesys/2/chat/request-chat",
userData: {},
proactive: {
enabled: false,
idleTimer: 5,
cancelTimer: 30
},
chatButton: {
enabled: false,
template: false,
openDelay: 1000,
effectDuration: 10,
emojis: false,
hideDuringInvite: true
},
}
};
[/code]
Then, I am including the widget JS async:
[code]
(function(d, s, id, o){
var f = function(){
var fs = d.getElementsByTagName(s)[0], e;
if (d.getElementById(id)) return;e = d.createElement(s); e.id = id;
e.src = o.src;fs.parentNode.insertBefore(e, fs);
},ol = window.onload;
if(o.onload){typeof window.onload != "function"?window.onload=f:window.onload=function(){ol();f()}}else f();
})(document,'script','genesys-cx-widget', {src: "widgets.min.js", onload: false});
[/code]
And finally, I am loading the <div> and using the Widget bus for managing the events:
[code]<body>
<div id="buttons">
<div class="cx-widget cx-webchat-chat-button" data-gcb-service-node="true" id="chat" style="top: 370px"><span class="i18n">CHAT</span></div>
</div>
</body>
<script>
jQuery(function($) {
$("#chat").click(function(event) {
var div;
var oWidgetBus = window._genesys.cxwidget.bus;
if (typeof oWidgetBus !== undefined) {
oWidgetBus.subscribe("WebChat.closed", function(e){
div.appendTo("body");
div = null;
});
oWidgetBus.subscribe("WebChat.opened", function(e){
div = $("#buttons").detach();
});
oWidgetBus.command("WebChat.open", {}).done(function(e){
}).fail(function(e){
})
}
});
});
</script>[/code]
This way I am able to use the widget, and it is working, but as mentioned before, if I add a configuration such 'emojis: false' under the webchat configuration section, it just does nothing and emojis menu keep showing. No error is thrown, though:
[img]https://imgur.com/2iUg2XX.png[/img]
However, and here is my big concern and what drives me crazy, if I use the namespace shown in the documentation, [b]'_genesys.widgets'[/b], it stops showing the widget shown above (which is the one that appears in all Genesys doc) and it shows a complete different panel, which I am not sure at all how to deal with:
[img]https://imgur.com/CQwaA8L.png[/img]
Any ideas about what I am using wrong? Do you have an example of a widget with a custom form or some other option configured that actually works?
Kind regards.
Ray