Updated on 2024-07-30 GMT+08:00

Displaying a Toast Message

Function

This API is used to display a toast message.

Function Prototype

showToast(toastInfo: ToastInfo, onShowToastResult?: (ret: SDKERR, reason: string) => void): voidshowToast(toastInfo: ToastInfo, onShowToastResult?: (ret: SDKERR, reason: string) => void): void

Request Parameters

Table 1 Input parameter description
Parameter Mandatory Type Description
toastInfo Yes ToastInfo Toast message.
onShowToastResult Yes (ret: SDKERR, reason: string) => void Callback of displaying a toast message.
Table 2 ToastInfo
Parameter Mandatory Type Description
content Yes string Toast message.
duration Yes number Display duration, in seconds.

Return Values

void

Callback Method Parameters

(ret: SDKERR, reason: string) => void

Table 3 Input parameter description
Parameter Type Description
ret For details about SDKERR, see Error Code Reference. Error code.
reason string Error description.