HomeDocs
Skip to main content

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

PropertyTypeDefaultRequiredDescription
successfunctionNoCallback function for a successful interface call
failfunctionNoCallback function for a failed interface call
completefunctionNoCallback function for the completion of the interface call (executed whether the call was successful or not)

object.success Callback Function

Parameters

Object res

PropertyTypeDescription
successstringtrue - success
isResumedbooleantrue: foreground; false: background

object.fail Callback Function

Parameters

Object res

PropertyTypeDescription
successstringfalse - setting failed

Sample Code

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