From 18b6f7d12e938ee3de809e4489e55ec4a1c235d0 Mon Sep 17 00:00:00 2001 From: DCloud_LXH <283700113@qq.com> Date: Mon, 18 Jul 2022 10:58:14 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20getAppAuthorizeSetting=E3=80=81getSyst?= =?UTF-8?q?emSetting?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/api/system/getappauthorizesetting.md | 32 +++++++++++++---------- docs/api/system/getsystemsetting.md | 8 +++++- 2 files changed, 25 insertions(+), 15 deletions(-) diff --git a/docs/api/system/getappauthorizesetting.md b/docs/api/system/getappauthorizesetting.md index 7ce945316..13d558a5d 100644 --- a/docs/api/system/getappauthorizesetting.md +++ b/docs/api/system/getappauthorizesetting.md @@ -11,23 +11,27 @@ |属性|类型|说明|平台差异说明| |:-|:-|:-|:-| -|albumAuthorized|'authorized'/'denied'/'not determined'|允许使用相册的开关|App 端仅 iOS 有效| -|bluetoothAuthorized|'authorized'/'denied'/'not determined'|允许使用蓝牙的开关|App 端仅 iOS 有效| -|cameraAuthorized|'authorized'/'denied'/'not determined'|允许使用摄像头的开关|| -|locationAuthorized|'authorized'/'denied'/'not determined'|允许使用定位的开关|| -|locationReducedAccuracy|boolean|定位准确度。true 表示模糊定位,false 表示精确定位|App 端仅 iOS 有效| -|microphoneAuthorized|'authorized'/'denied'/'not determined'|允许使用麦克风的开关| -|notificationAuthorized|'authorized'/'denied'/'not determined'|允许通知的开关|| -|notificationAlertAuthorized|'authorized'/'denied'/'not determined'|允许通知带有提醒的开关|App 端仅 iOS 有效| -|notificationBadgeAuthorized|'authorized'/'denied'/'not determined'|允许通知带有标记的开关|App 端仅 iOS 有效| -|notificationSoundAuthorized|'authorized'/'denied'/'not determined'|允许通知带有声音的开关|App 端仅 iOS 有效| -|phoneCalendarAuthorized|'authorized'/'denied'/'not determined'|允许读写日历的开关|App 端不支持| +|albumAuthorized|'authorized'/'denied'/'not determined'/'config error'|允许使用相册的开关|App 端仅 iOS 支持| +|bluetoothAuthorized|'authorized'/'denied'/'not determined'/'config error'|允许使用蓝牙的开关|App 端仅 iOS 支持| +|cameraAuthorized|'authorized'/'denied'/'not determined'/'config error'|允许使用摄像头的开关|| +|locationAuthorized|'authorized'/'denied'/'not determined'/'config error'|允许使用定位的开关|| +|locationAccuracy|String|定位准确度。`"reduced"` 表示模糊定位;`"full"` 表示精准定位;`"unsupported"` 表示不支持|App 端仅 iOS 支持| +|microphoneAuthorized|'authorized'/'denied'/'not determined'/'config error'|允许使用麦克风的开关| +|notificationAuthorized|'authorized'/'denied'/'not determined'/'config error'|允许通知的开关|| +|notificationAlertAuthorized|'authorized'/'denied'/'not determined'/'config error'|允许通知带有提醒的开关|App 端仅 iOS(10.0+)| +|notificationBadgeAuthorized|'authorized'/'denied'/'not determined'/'config error'|允许通知带有标记的开关|App 端仅 iOS(10.0+)| +|notificationSoundAuthorized|'authorized'/'denied'/'not determined'/'config error'|允许通知带有声音的开关|App 端仅 iOS(10.0+)| +|phoneCalendarAuthorized|'authorized'/'denied'/'not determined'/'config error'|允许读写日历的开关|App 端不支持| + +#### 不推荐使用的返回参数,仅为兼容保留 +|locationReducedAccuracy|boolean|定位准确度。true 表示模糊定位,false 表示精确定位 |App 端仅 iOS 支持| **Tips:** -`'authorized'` 表示已经获得授权,无需再次请求授权; -`'denied'` 表示请求授权被拒绝,无法再次请求授权;(此情况需要引导用户打开系统设置,在设置页中打开权限) -`'non determined'` 表示尚未请求授权,会在App下一次调用系统相应权限时请求;(仅 iOS 会出现。此种情况下引导用户打开系统设置,不展示开关) +- `'authorized'`:表示已经获得授权,无需再次请求授权; +- `'denied'`:表示请求授权被拒绝,无法再次请求授权;(此情况需要引导用户打开系统设置,在设置页中打开权限) +- `'non determined'`:表示尚未请求授权,会在App下一次调用系统相应权限时请求;(仅 iOS 会出现。此种情况下引导用户打开系统设置,不展示开关) +- `'config error'`:在 `Android平台` 表示没有对应的权限。在 `iOS平台` 表示没有在 `manifest.json -> App模块配置` 勾选对应的配置 **示例** diff --git a/docs/api/system/getsystemsetting.md b/docs/api/system/getsystemsetting.md index a3aef5117..d06357024 100644 --- a/docs/api/system/getsystemsetting.md +++ b/docs/api/system/getsystemsetting.md @@ -12,11 +12,17 @@ |属性|类型|说明| |:-|:-|:-| -|bluetoothEnabled|boolean|蓝牙的系统开关| +|bluetoothEnabled|boolean|蓝牙的系统开关。在没有 `bluetoothError` 时该值准确| +|bluetoothError|String/undefined|App平台模块错误时返回,配置正确时不返回此属性。详情见下| |locationEnabled|boolean|地理位置的系统开关| +|locationError|String/undefined|App平台模块错误时返回,配置正确时不返回此属性。详情见下| |wifiEnabled|boolean|Wi-Fi 的系统开关| |deviceOrientation|string|设备方向。`竖屏:portrait`,`横屏:landscape`| +**Tips** +- `bluetoothError`:`Android平台` 没有蓝牙权限是返回值为 `"Missing permissions required by BluetoothAdapter.isEnabled: android.permission.BLUETOOTH"`,`iOS平台` 没有配置蓝牙模块返回值为 `"Missing bluetooth module in manifest.json"` +- `locationError`:`iOS平台` 没有定位权限 `"Missing geolocation module in manifest.json"` + **示例** ```javascript -- GitLab