HomeDocs
Skip to main content

Check if the Mini Program is Added to the Desktop

methodName: queryShortcutExists​

Additional Parameters:​

None

Success Callback Function​

Parameters​

Object res​

PropertyTypeDescription
successStringDescribes whether the interface call was successful or not. "true" for success, "false" for failure.
isExistBooleanIndicates whether the mini program is already added to the desktop. true if it's added, false if not.
latestShowTimeNumberTimestamp in milliseconds of the most recent prompt to add to the desktop.

Fail Callback Function​

Parameters​

Object res​

PropertyTypeDescription
successStringDescribes whether the interface call was successful or not. "true" for success, "false" for failure.
errMsgStringError message.

Example Usage​

const dlt = window['@transsion/byteh5bridge'];
const canCallDlt = dlt && window.dltms && window.dltms.isMiniShellGame();

if (canCallDlt) {
dlt.callApi('queryShortcutExists', {
success: (res) => {
console.log('Success: ', res);
},
fail: (res) => {
console.log('Fail: ', res);
},
complete: (res) => {
console.log('Complete: ', res);
},
});
}
Privacy agreementDeveloper agreementcontact us: developer_private.mi@dlightek.com © 2024 MiniApp. All Rights Reserved.