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
Property | Type | Default | Required | Description |
---|---|---|---|---|
success | function | No | Callback function for successful API invocation | |
fail | function | No | Callback function for failed API invocation | |
complete | function | No | Callback function called after API invocation (executed regardless of success or failure) |
object.success Callback Function
Parameters
Object res
Property | Type | Description |
---|---|---|
success | string | true - successful |
isExist | boolean | Whether the shortcut has been added to the desktop, true: added, false: not added |
latestShowTime | number | Timestamp of the most recent prompt to add to the desktop, in milliseconds |
object.fail Callback Function
Parameters
Object res
Property | Type | Description |
---|---|---|
success | string | false - unsuccessful |
Sample Code
// pages/index/index.js
Page({
queryShortcutExists() {
dlt.queryShortcutExists({
success: (res) => {
console.log('isExist:', res.isExist);
},
});
},
});