dlt.getMiniappResumedStatus
Introduction
Retrieve the current status of whether the mini-program is in the foreground.
Usage Restrictions
Supported in the basic library from version 5.0.0
or higher.
Parameters
Object object
Property | Type | Default | Required | Description |
---|---|---|---|---|
success | function | No | Callback function for a successful interface call | |
fail | function | No | Callback function for a failed interface call | |
complete | function | No | Callback function for the completion of the interface call (executed whether the call was successful or not) |
object.success Callback Function
Parameters
Object res
Property | Type | Description |
---|---|---|
success | string | true - success |
isResumed | boolean | true: foreground; false: background |
object.fail Callback Function
Parameters
Object res
Property | Type | Description |
---|---|---|
success | string | false - setting failed |
Sample Code
// pages/index/index.js
Page({
getMiniappResumedStatus() {
dlt.getMiniappResumedStatus({
success: (res) => {
console.log('isResumed:', res.isResumed);
},
});
},
});