Object bl.getSystemSetting()
iOS 和 Android App 9.19.0 起支持,低版本需做兼容处理。
获取设备设置。
返回值
Object
| 属性 | 类型 | 说明 |
|---|---|---|
| bluetoothEnabled | boolean | 蓝牙的系统开关 |
| locationEnabled | boolean | 地理位置的系统开关 |
| wifiEnabled | boolean | Wi-Fi 的系统开关 |
| deviceOrientation | string | 设备方向:portrait 为竖屏,landscape 为横屏。iOS 横屏游戏中返回值可能不准确,建议根据屏幕宽高判断。 |
示例代码
const systemSetting = bl.getSystemSetting()
console.log(systemSetting.bluetoothEnabled)
console.log(systemSetting.deviceOrientation)
console.log(systemSetting.locationEnabled)
console.log(systemSetting.wifiEnabled)