Nhảy tới nội dung

Bắt đầu hỗ trợ ở phiên bản:

  • SDK: 2.5.3
Lưu ý

Cần xin cấp quyền tại trang Quản lý ứng dụng

Cho phép ứng dụng hiển thị toast trên màn hình Zalo App

Parameters​

Object object​

PropertyTypeDefaultRequiredDescriptionMinimum Version
messagestringtrueNội dung toast cần show
successfunctionCallback function khi gọi api thành công
failfunctionCallback function khi gọi api thất bại

Sample Code​

import { showToast } from "zmp-sdk/apis";

showToast({
message: "hello",
success: (data) => {
// xử lý khi gọi api thành công
},
fail: (error) => {
// xử lý khi gọi api thất bại
console.log(error);
}
});

Hoặc

import { showToast } from "zmp-sdk/apis";

const openToast = async () => {
try {
const data = await showToast({
message: "hello"
});
} catch (error) {
// xử lý khi gọi api thất bại
console.log(error);
}
};