HomeDocs
Skip to main content

dlt.getSystemInfoAsync

Introduction

Asynchronously retrieve system information.

Usage Limitations

Supported in the basic library version 4.0.0 or higher.

Parameters

Object object

PropertyTypeDefaultRequiredDescription
successfunctionNoCallback function for a successful API call.
failfunctionNoCallback function for a failed API call.
completefunctionNoCallback function for the completion of the API call (executed whether the call is successful or not).

object.success Callback Function

Parameters

Object res

PropertyTypeDescription
successstringtrue - Successful retrieval.
modelstringModel of the phone.
pixelRationumberDevice pixel ratio.
windowWidthnumberWindow width in dp.
windowHeightnumberWindow height in dp.
languagestringSet language following the ISO 639 standard.
frameworkversionstringMini-program basic library version.
storagestringDevice disk capacity.
currentBatterystringCurrent battery percentage.
systemstringSystem version.
platformstringSystem name: Android, iOS / iPhone OS.
screenWidthnumberScreen width in px.
screenHeightnumberScreen height in px.
brandstringPhone brand.
packageNamestringPackage name.
gaidstringThe device id of the host app.
countrystringCountry.
mccstringCountry code.
capsuleHeightnumberCapsule height in px.
capsuleWidthnumberCapsule width in px.
capsuleTranslationYnumberCapsule vertical offset in px.
capsuleTranslationXnumberCapsule horizontal offset in px.
statusBarHeightnumberStatus bar height in px.

object.fail Callback Function

Parameters

Object res

PropertyTypeDescription
successstringfalse - Retrieval failed.

Sample Code

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