Nhảy tới nội dung

createShortcut

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

  • API: 2.5.3
Lưu ý

Với API version ﹤ 2.23.0, phải gọi api login trước khi gọi api này và cần xin cấp quyền tại trang Quản lý ứng dụng

Cho phép ứng dụng tạo shortcut trên màn hình chờ. Lưu ý: hỗ trợ ios từ API phiên bản 2.16.1.

Quy trình tạo shortcut trên android

shorcut android

Lưu ý: params khác nhau sẽ tạo shortcut khác nhau

Quy trình tạo shortcut trên ios

shorcut ios

Parameters

Object object

PropertyTypeDefaultRequiredDescriptionMinimum Version
paramsObject<[key: string]: string>Params cần thêm vào Zalo Mini App khi mở2.16.3
successfunctionCallback function khi gọi api thành công
failfunctionCallback function khi gọi api thất bại

Sample Code

import api from 'zmp-sdk';

api.createShortcut({
params: {
utm_source: 'shortcut'
}
});

// hoặc
const test = async () => {
try {
await api.createShortcut({
params: {
utm_source: 'shortcut'
}
});
} catch (error) {
// xử lý khi gọi api thất bại
console.log(error);
}
};