Legacy Dev Forum Posts

 View Only

Sign Up

showToastPopup not working

  • 1.  showToastPopup not working

    Posted 06-05-2025 18:24

    Nicholas_Armaline | 2022-11-09 14:39:41 UTC | #1

    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


    Jerome.Saint-Marc | 2022-11-09 15:33:31 UTC | #2

    Hello,

    When using type 'error', the Genesys Cloud client requires the showCloseButton to be enabled.

    var options = { type: 'error', showCloseButton: true };

    Regards,


    Nicholas_Armaline | 2022-11-09 16:14:28 UTC | #3

    Jerome.Saint-Marc, post:2, topic:17150
    { type: 'error', showCloseButton: true }
    I have tried both of theses and neither work:

    myClientApp.alerting.showToastPopup("test","test", { type: 'error', showCloseButton: true }); myClientApp.alerting.showToastPopup("test","test");


    Jerome.Saint-Marc | 2022-11-09 16:20:47 UTC | #4

    I have tried it - using the toast example listed on dev center and it worked for me. Setting the following as my Client App integration Application URL: https://mypurecloud.github.io/client-app-sdk/toast.html?pcEnvironment={{pcEnvironment}}&pcLangTag={{pcLangTag}}

    Regards,


    Nicholas_Armaline | 2022-11-16 19:16:44 UTC | #5

    Nicholas_Armaline, post:1, topic:17150
    myClientApp = new window.purecloud.apps.ClientApp();

    This is the line that was causing the issues. In the toast.html, it was assigning the pcEnvironment with the creation of ClientApp("pcEnvironment");


    system | 2022-12-10 19:04:05 UTC | #6

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


    This post was migrated from the old Developer Forum.

    ref: 17150