开发者社区
社区提问意见反馈
开发者钉组织
扫描二维码
加入支付宝开发者钉组织
基础 api
基础
应用级事件
界面
跳转
多媒体
缓存
文件
位置
网络
设备
系统信息
网络状态
截屏
剪贴板
摇一摇
振动
加速度计
陀螺仪
罗盘
设备方向
拨打电话
获取服务器时间
用户截屏事件
屏幕亮度
设置
添加手机联系人
无障碍
权限引导
扫码
内存不足告警
获取设备电量
蓝牙
wi-fi
短信
worker
数据安全
分享
收藏
自定义通用菜单
更新管理
web-view组件控制
升级支付宝最新版本
隐私信息授权
小程序广告
开放能力 api
开发 > api > 基础 api > 设备 > 系统信息 > my.getappauthorizesetting
评论 (1)
收藏
订阅更新
我的文档
设置

object my.getappauthorizesetting()

基础库  或更高版本, 且 支付宝客户端 10.2.80 或更高版本。 若版本较低,建议采取 兼容处理

主体: 企业支付宝小程序个人支付宝小程序

获取支付宝 app 授权设置。

object

查看示例
属性类型兼容性描述
albumauthorizedstring-允许支付宝使用相册的开关(仅 ios 有效)。枚举值:'authorized'、'denied'、'not determined'。
bluetoothauthorizedstring
安卓: 10.5.50
允许支付宝使用蓝牙的开关。枚举值:'authorized'、'denied'、'not determined'。
cameraauthorizedstring-允许支付宝使用摄像头的开关。枚举值:'authorized'、'denied'、'not determined'。
locationauthorizedstring-允许支付宝使用定位的开关。枚举值:'authorized'、'denied'、'not determined'。
locationreducedaccuracyboolean-定位准确度。true 表示模糊定位,false 表示精确定位(仅 ios 有效)。
microphoneauthorizedstring-允许支付宝使用麦克风的开关。枚举值:'authorized'、'denied'、'not determined'。
notificationauthorizedstring-允许支付宝通知的开关。枚举值:'authorized'、'denied'、'not determined'。
notificationalertauthorizedstring-允许支付宝通知带有提醒的开关(仅 ios 有效)。枚举值:'authorized'、'denied'、'not determined'。
notificationbadgeauthorizedstring-允许支付宝通知带有标记的开关(仅 ios 有效)。枚举值:'authorized'、'denied'、'not determined'。
notificationsoundauthorizedstring-允许支付宝通知带有声音的开关(仅 ios 有效)。枚举值:'authorized'、'denied'、'not determined'。
overlayauthorizedstring-允许支付宝使用悬浮窗的开关(仅 android 有效)。枚举值:'authorized'、'denied'、'not determined'。
phonecalendarauthorizedstring-允许支付宝读写日历的开关。枚举值:'authorized'、'denied'、'not determined'。

返回值说明

'authorized' 表示已经获得授权,无需再次请求授权。
'denied' 表示请求授权被拒绝,无法再次请求授权(此情况需要引导用户 打开系统设置,在设置页中打开权限)。
'not determined' 表示尚未请求授权,会在支付宝下一次调用系统相应权限时请求(仅 ios 会出现。此种情况下引导用户打开系统设置,授权界面不展示开关)。
my.getappauthorizesetting()
返回值
const appauthorizesetting = my.getappauthorizesetting();
console.log(appauthorizesetting);
{
    "cameraauthorized": "authorized",
    "locationauthorized": "denied",
    "microphoneauthorized": "denied",
    "notificationauthorized": "authorized",
    "overlayauthorized": "denied",
    "phonecalendarauthorized": "authorized",
    "bluetoothauthorized": "authorized"
}
内容没有解决您的问题?您还可以前往 或 寻求帮助
凯发k8官方网娱乐官方 copyright © 2022 支付宝(杭州)信息技术有限公司  | icp证浙b2-20160559
该文档对你是否有帮助?
当前页面目录
网站地图