# wx.getAppAuthorizeSetting
- Obtain App Authorization settings. That is, developers can use this interface to determine which permissions the user has granted to App And...
- Note: Android and iOS There's a difference,
not determined
Value only iOS Will return, Android No. 'no determined'
Indicates that authorization has not been requested. It will appear in the App Request the next time the system is invoked with the corresponding permission
# Return value
# Android
attribute | Return value | Introductions | Android Native permissions |
---|---|---|---|
cameraAuthorized | 'authorized'/'denied' | allow App Access switch to use the camera | CAMERA |
locationAuthorized | 'authorized'/'denied' | allow App Use the Location Access Switch | ACCESS_FINE_LOCATION |
microphoneAuthorized | 'authorized'/'denied' | allow App Access switch to use microphone | RECORD_AUDIO |
notificationAuthorized | 'authorized'/'denied' | allow App Notification permission switch | / |
phoneCalendarAuthorized | 'authorized' | allow App Access switch for reading and writing calendars | Adding a calendar does not currently involve system authorization, so uniform returns 'authorized' |
mediaAudioAuthorized | 'authorized'/'denied' | allow App Access switch to read audio files | READ_MEDIA_VIDEO targetsdkversion 33 Following It reads READ_EXTERNAL_STORAGE |
mediaImagesAuthorized | 'authorized'/'denied' | allow App Access switch to read image files | READ_MEDIA_VIDEO targetsdkversion 33 Following It reads READ_EXTERNAL_STORAGE |
mediaVideoAuthorized | 'authorized'/'denied' | allow App Access switch to read video files | READ_MEDIA_VIDEO targetsdkversion 33 Following It reads READ_EXTERNAL_STORAGE |
albumAuthorized | 'undefined' | only iOS Valid, so return the 'undefined', Android End-negligible | / |
albumAddOnlyAuthorized | 'undefined' | only iOS Valid, so return the 'undefined', Android End-negligible | / |
bluetoothAuthorized | 'undefined' | only iOS Valid, so return the 'undefined', Android End-negligible | / |
locationReducedAccuracy | 'undefined' | only iOS Valid, so return the 'undefined', Android End-negligible | / |
notificationAlertAuthorized | 'undefined' | only iOS Valid, so return the 'undefined', Android End-negligible | / |
notificationBadgeAuthorized | 'undefined' | only iOS Valid, so return the 'undefined', Android End-negligible | / |
notificationSoundAuthorized | 'undefined' | only iOS Valid, so return the 'undefined', Android End-negligible | / |
- To use the permissions mentioned above, the developer needs to be in the Developer Tools. - project.miniapp.json A popup window for authorization requests will appear only when the permissions are configured in.
# iOS
attribute | Return value | Introductions |
---|---|---|
albumAuthorized | 'authorized'/'denied'/'not determined' | allow App Use the permission switch for the album |
albumAddOnlyAuthorized | 'authorized'/'denied'/'not determined' | allow App Permission switch for read-only albums |
bluetoothAuthorized | 'authorized'/'denied'/'not determined' | allow App Access switch using Bluetooth |
cameraAuthorized | 'authorized'/'denied'/'not determined' | allow App Access switch to use the camera |
locationAuthorized | 'authorized'/'denied'/'not determined' | allow App Use the Location Access Switch |
locationReducedAccuracy | boolean | Positioning accuracy. true Indicates fuzzy positioning, false Indicates precise positioning |
microphoneAuthorized | 'authorized'/'denied'/'not determined' | allow App Access switch to use microphone |
notificationAuthorized | 'authorized'/'denied'/'not determined' | allow App Notification permission switch |
notificationAlertAuthorized | 'authorized'/'denied'/'not determined' | allow App Notification Permission switch with reminder |
notificationBadgeAuthorized | 'authorized'/'denied'/'not determined' | allow App Notification of marked permission switches |
notificationSoundAuthorized | 'authorized'/'denied'/'not determined' | allow App Notification of permission switch with sound |
phoneCalendarAuthorized | 'authorized'/'denied'/'not determined' | allow App Access switch for reading and writing calendars |
- To use the permissions mentioned above, the developer needs to be in the Developer Tools. - project.miniapp.json A popup window for authorization requests will appear only when the permissions are configured in.
# sample code
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)