Nhảy tới nội dung

getStorageInfo

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

Lấy thông tin của cache.

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
currentSizenumberKhông gian hiện tại bị chiếm (tính bằng KB)
limitSizenumberGiới hạn kích thước không gian (tính bằng KB)

Sample Code​

import api from 'zmp-sdk';

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

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