HomeDocs
Skip to main content

dlt.queryShortcutExists

Introduction​

Query whether the shortcut for the mini program has been added to the desktop.

Usage Limitations​

This feature is supported by the base library version 4.0.0 or higher.

Parameters​

Object object

PropertyTypeDefaultRequiredDescription
successfunctionNoCallback function for successful API invocation
failfunctionNoCallback function for failed API invocation
completefunctionNoCallback function called after API invocation (executed regardless of success or failure)

object.success Callback Function​

Parameters​

Object res​

PropertyTypeDescription
successstringtrue - successful
isExistbooleanWhether the shortcut has been added to the desktop, true: added, false: not added
latestShowTimenumberTimestamp of the most recent prompt to add to the desktop, in milliseconds

object.fail Callback Function​

Parameters​

Object res​

PropertyTypeDescription
successstringfalse - unsuccessful

Sample Code​

// pages/index/index.js
Page({
queryShortcutExists() {
dlt.queryShortcutExists({
success: (res) => {
console.log('isExist:', res.isExist);
},
});
},
});
Privacy agreementDeveloper agreementcontact us: developer_private.mi@dlightek.com © 2024 MiniApp. All Rights Reserved.