Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
你丑我先上
unidocs-zh
提交
43a2614a
U
unidocs-zh
项目概览
你丑我先上
/
unidocs-zh
与 Fork 源项目一致
Fork自
DCloud / unidocs-zh
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
unidocs-zh
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
43a2614a
编写于
7月 15, 2022
作者:
D
DCloud_LXH
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat: getAppAuthorizeSetting、getSystemSetting
上级
b61ffa02
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
77 addition
and
0 deletion
+77
-0
docs/api/system/getappauthorizesetting.md
docs/api/system/getappauthorizesetting.md
+48
-0
docs/api/system/getsystemsetting.md
docs/api/system/getsystemsetting.md
+29
-0
未找到文件。
docs/api/system/getappauthorizesetting.md
0 → 100644
浏览文件 @
43a2614a
### uni.getAppAuthorizeSetting()
获取 APP 授权设置
**平台差异说明**
|App|H5|微信小程序|支付宝小程序|百度小程序|字节跳动小程序、飞书小程序|钉钉小程序|QQ小程序|快手小程序|京东小程序|
|:-:|:-:|:-:|:-:|:-:|:-:|:-:|:-:|:-:|:-:|
|HBuilderX 3.5.2+|x|基础库 2.20.1+|x|x|x|x|x|x|x|
**返回参数说明**
|属性|类型|说明|平台差异说明|
|:-|:-|:-|:-|
|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 端不支持|
**Tips:**
`'authorized'`
表示已经获得授权,无需再次请求授权;
`'denied'`
表示请求授权被拒绝,无法再次请求授权;(此情况需要引导用户打开系统设置,在设置页中打开权限)
`'non determined'`
表示尚未请求授权,会在App下一次调用系统相应权限时请求;(仅 iOS 会出现。此种情况下引导用户打开系统设置,不展示开关)
**示例**
```
javascript
const
appAuthorizeSetting
=
uni
.
getAppAuthorizeSetting
()
console
.
log
(
appAuthorizeSetting
.
albumAuthorized
)
console
.
log
(
appAuthorizeSetting
.
bluetoothAuthorized
)
console
.
log
(
appAuthorizeSetting
.
cameraAuthorized
)
console
.
log
(
appAuthorizeSetting
.
locationAuthorized
)
console
.
log
(
appAuthorizeSetting
.
locationReducedAccuracy
)
console
.
log
(
appAuthorizeSetting
.
microphoneAuthorized
)
console
.
log
(
appAuthorizeSetting
.
notificationAlertAuthorized
)
console
.
log
(
appAuthorizeSetting
.
notificationAuthorized
)
console
.
log
(
appAuthorizeSetting
.
notificationBadgeAuthorized
)
console
.
log
(
appAuthorizeSetting
.
notificationSoundAuthorized
)
console
.
log
(
appAuthorizeSetting
.
phoneCalendarAuthorized
)
```
docs/api/system/getsystemsetting.md
0 → 100644
浏览文件 @
43a2614a
### uni.getSystemSetting()
获取设备设置
**平台差异说明**
|App|H5|微信小程序|支付宝小程序|百度小程序|字节跳动小程序、飞书小程序|钉钉小程序|QQ小程序|快手小程序|京东小程序|
|:-:|:-:|:-:|:-:|:-:|:-:|:-:|:-:|:-:|:-:|
|HBuilderX 3.5.2+|x|基础库 2.20.1+|x|x|x|x|x|x|x|
**返回参数说明**
|属性|类型|说明|
|:-|:-|:-|
|bluetoothEnabled|boolean|蓝牙的系统开关|
|locationEnabled|boolean|地理位置的系统开关|
|wifiEnabled|boolean|Wi-Fi 的系统开关|
|deviceOrientation|string|设备方向。
`竖屏:portrait`
,
`横屏:landscape`
|
**示例**
```
javascript
const
systemSetting
=
uni
.
getSystemSetting
()
console
.
log
(
systemSetting
.
bluetoothEnabled
)
console
.
log
(
systemSetting
.
deviceOrientation
)
console
.
log
(
systemSetting
.
locationEnabled
)
console
.
log
(
systemSetting
.
wifiEnabled
)
```
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录