大学生新闻网,大学生新闻发布平台
大学生新闻网
大学生新闻大学生活校园文学大学生村官
社会实践活动社会实践经历社会实践报告社会实践总结社会实践心得
全国排名校友会版软科排名分类排名本科排名一本排名二本排名专科排名学校地址
求职简历职场法则面试技巧职场故事求职招聘大学生就业
英语学习计算机学习电气工程机械工程经济管理建筑设计财务会计
申请书证明书检讨书自荐信演讲稿心得体会调查报告读后感求职信推荐信其它范文

小程序wx.getAppAuthorizeSetting

Object wx.getAppAuthorizeSetting()
获取微信APP授权设置

基础库 2.20.1 开始支持,低版本需做兼容处理。
小程序插件:支持,需要小程序基础库版本不低于 2.21.3
返回值
Object
属性    类型    说明
albumAuthorized    'authorized'/'denied'/'not determined'    允许微信使用相册的开关(仅 iOS 有效)
bluetoothAuthorized    'authorized'/'denied'/'not determined'    允许微信使用蓝牙的开关(仅 iOS 有效)
cameraAuthorized    'authorized'/'denied'/'not determined'    允许微信使用摄像头的开关
locationAuthorized    'authorized'/'denied'/'not determined'    允许微信使用定位的开关
locationReducedAccuracy    boolean    定位准确度。true 表示模糊定位,false 表示精确定位(仅 iOS 有效)
microphoneAuthorized    'authorized'/'denied'/'not determined'    允许微信使用麦克风的开关
notificationAuthorized    'authorized'/'denied'/'not determined'    允许微信通知的开关
notificationAlertAuthorized    'authorized'/'denied'/'not determined'    允许微信通知带有提醒的开关(仅 iOS 有效)
notificationBadgeAuthorized    'authorized'/'denied'/'not determined'    允许微信通知带有标记的开关(仅 iOS 有效)
notificationSoundAuthorized    'authorized'/'denied'/'not determined'    允许微信通知带有声音的开关(仅 iOS 有效)
phoneCalendarAuthorized    'authorized'/'denied'/'not determined'    允许微信读写日历的开关
示例代码
const appAuthorizeSetting = wx.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)
    作者:大学生新闻网    来源:大学生新闻网
    发布时间:2025-04-02    阅读:
    扫一扫 分享悦读
  • 小程序wx.getSystemInfo
  • 获取系统信息。由于历史原因,wx.getSystemInfo 是异步的调用格式,但是是同步返回,需要异步获取系统信息请使用 wx.getSystemInfoAsy
  • 04-02 关注:0
  • 小程序wx.getSystemInfoAsync
  • 异步获取系统信息。需要一定的微信客户端版本支持,在不支持的客户端上,会使用同步实现来返回。
  • 04-02 关注:0