showToast
Description
Open a toast screen to display information to the user in a short period of time
Parameters
Param | Data type | Required | Description |
---|---|---|---|
message | string | Yes | Content of the toast |
position | string | Yes | The toast display position, has one of two values "bottom" or "center" |
iconUrl | string | No | Url to the icon displayed on the toast |
buttonText | string | No | Title of the button (when position is "bottom" , Toast can have a button) |
duration | number | No (Default: 4 ) | Toast auto-hidden time (in seconds) |
onButtonClick | () => any | No | The action is triggered when the user press the button |
Return Value
N/A
Error Code
N/A
Sample Code and Sample Return Data
Sample Request:
window.zlpSdk.UI
.showToast({ message: "Thao tác thành công", position: "center" })
.then((response) => console.log(response))
.catch((error) => console.error(error.errorCode));
Sample Response:
{ data: {}, status: "success" }