my.getSystemInfo retrieves the system information of the current device, including model, operating system version, screen resolution, and other device characteristics.
my.getSystemInfo({
success: (res) => {
console.log(res.model);
console.log(res.pixelRatio);
console.log(res.windowWidth);
console.log(res.windowHeight);
console.log(res.language);
console.log(res.version);
console.log(res.platform);
},
});
| Property | Type | Required | Description |
|---|---|---|---|
success | Function | No | Callback function upon call success. |
fail | Function | No | Callback function upon call failure. |
complete | Function | No | Callback function upon call completion (to be executed upon either call success or failure). |
The incoming parameter is of the Object type with the following attributes:
| Property | Type | Description |
|---|---|---|
model | String | Device model. |
pixelRatio | Number | Device pixel ratio. |
windowWidth | Number | Window width in px. |
windowHeight | Number | Window height in px. |
language | String | System language. |
version | String | Version number. |
storage | String | Storage capacity of the device. |
currentBattery | String | Current battery level. |
system | String | System version. |
platform | String | System platform. |
titleBarHeight | String | Title bar height. |
statusBarHeight | String | Status bar height. |
screenWidth | Number | Screen width in px. |
screenHeight | Number | Screen height in px. |
brand | String | Device brand. |
fontSizeSetting | Number | User font size setting. |
app | String | Host app name. |
safeArea | Object | Safe area information. |
success callback