ClientApp SDK: Show Toast

I am using the ShowToastPopup API in the Client Apps SDK and it is throwing this error
"Toast must have either a nonzero timeout or a close button"

I am though sending a non-zero value for timeout.

Code Snip:

function showPopup () {
let options = { 

                    type: 'error', 

                    timeout: 5, 

                    showCloseButton: false 

                };

                clientApp.purecloudClientApi.alerting.showToastPopup("Outstanding calls", "There are outstanding outbound calls being made and you cannot currently go off queue.  Please go off queue before you wrapup your next call.", options);
}

Hello,

I just made few tests on my side, with the Client App SDK.

Apparently, when using type 'error', the PureCloud client requires the showCloseButton to be enabled (I have tried with the different types: 'error', 'success', 'info').
Then if type is 'success' or 'info', it requires a non-zero value for timeout or a close button.
NB: The "Toast must have either a nonzero timeout or a close button" error is raised by the PureCloud client (not by the Client App SDK).

Please open a case with Genesys Cloud Care - so that if there is such constraint on type 'error', it gets documented or reported more accurately in the error message, or fixed otherwise.

Regards,

Yeah, I can confirm that it's by-design that error messages cannot auto-dismiss and require a close button. The other restriction is that sticky toasts (non-dismissable, non-timeout) are not supported.

I agree that the error message is misleading. We can get the docs and error message improved to better convey these gotchas.

Thanks for the assist @Jerome.Saint-Marc.

@Michael.Shrall Thanks for the post. Could you use one of the other notification types for your toast message or make it manually dismissible? Does this fit your use case?

I am fine with the current abilities. Error requiring closure makes sense to me.

1 Like

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