I am attempting to create an Integration (client application) and I want to be able to have a popup message when we change our All Hands On Deck (AHOD) status. I am able to get everything to work except the the showToastPopup. Here is what I am working with:
var myClientApp;
var ahodHub;
$(document).ready(initPage);
function initPage() {
myClientApp = new window.purecloud.apps.ClientApp();
ahodHub = $.connection.aHODhub;
ahodHub.client.setLevel = setLevel;
$.connection.hub.start().done(function () {
ahodHub.server.getAhodLevel();
})
}
function setLevel(ahodLevel) {
var options = { type: 'error' };
switch (ahodLevel.Level) {
case 0:
ahod0();
break;
case 1:
ahod1();
break;
case 2:
ahod2();
break;
case 3:
ahod3();
break;
case 4:
ahod4();
break;
case 5:
ahod5();
break;
}
myClientApp.alerting.showToastPopup("AHOD Change!!!", $("#ahodWords").html(), options);
}
setLevel is called by websockets when the AHOD level changes. #ahodWords is a div that holds the current status defined by one of the ahod# Functions. I even tried to create a toast in the console and it didn't work.
thanks ahead of time