Nhảy tới nội dung

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

  • API: 2.11.0
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

Mở Webview.

Parameters

Object object

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

Sample Code

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

const openUrlInWebview = () => {
openWebview({
url: "https://mini.zalo.me/",
success: (res) => {
// 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 { openWebview } from "zmp-sdk/apis";

const openUrlInWebview = async () => {
try {
await openWebview({
url: "https://mini.zalo.me/",
});
} catch (error) {
// xử lý khi gọi api thất bại
console.log(error);
}
};