Nhảy tới nội dung

scanQRCode

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 mở tính năng quét QR Code của Zalo App và trả về kết quả sau khi người dùng quét thành công.

Parameters

Object object

PropertyTypeDefaultRequiredDescriptionMinimum Version
successfunctionCallback function khi gọi api thành công
failfunctionCallback function khi gọi api thất bại

Return Values

Promise<Object data>

PropertyTypeDescriptionMinimum Version
contentstringNội dung QR code

Sample Code

import api from 'zmp-sdk';

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

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