HomeDocs
Skip to main content

Get System Information

methodName: getSystemInfo

Additional Parameters:

None

Success Callback Function

Parameters

Object res

PropertyTypeDescription
modelstringPhone model
pixelRationumberDevice pixel ratio
windowWidthnumberWindow width
windowHeightnumberWindow height
languagestringLanguage setting, following ISO 639 standard.
frameworkversionstringFramework package version number
storagestringDevice storage capacity
currentBatterystringCurrent battery percentage
systemstringSystem version
platformstringSystem name: Android, iOS / iPhone OS
screenWidthnumberScreen width
screenHeightnumberScreen height
brandstringPhone brand
packageNamestringHost app package name
gaidstringThe device id of the host app
successStringDescribes whether the interface call was successful or not. "true" for success, "false" for failure

Fail Callback Function

Parameters

Object res

PropertyTypeDescription
successStringDescribes whether the interface call was successful or not. "true" for success, "false" for failure
errMsgStringError message

Example Usage

const dlt = window['@transsion/byteh5bridge'];
const canCallDlt = dlt && window.dltms && window.dltms.isMiniShellGame();

if (canCallDlt) {
dlt.callApi('getSystemInfo', {
success: (res) => {
console.log('Success: ', res);
},
fail: (res) => {
console.log('Fail: ', res);
},
complete: (res) => {
console.log('Complete: ', res);
},
});
}
Privacy agreementDeveloper agreementcontact us: developer_service.mi@transsion.com © 2024 MiniApp. All Rights Reserved.