Get System Information
methodName: getSystemInfo
Additional Parameters:
None
Success Callback Function
Parameters
Object res
Property | Type | Description |
---|---|---|
model | string | Phone model |
pixelRatio | number | Device pixel ratio |
windowWidth | number | Window width |
windowHeight | number | Window height |
language | string | Language setting, following ISO 639 standard. |
frameworkversion | string | Framework package version number |
storage | string | Device storage capacity |
currentBattery | string | Current battery percentage |
system | string | System version |
platform | string | System name: Android, iOS / iPhone OS |
screenWidth | number | Screen width |
screenHeight | number | Screen height |
brand | string | Phone brand |
packageName | string | Host app package name |
gaid | string | The device id of the host app |
success | String | Describes whether the interface call was successful or not. "true" for success, "false" for failure |
Fail Callback Function
Parameters
Object res
Property | Type | Description |
---|---|---|
success | String | Describes whether the interface call was successful or not. "true" for success, "false" for failure |
errMsg | String | Error 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);
},
});
}