Property | Description |
boolean scope.userLocation | Whether location access is authorized. The corresponding APIs are wx.getLocation and wx.chooseLocation. |
boolean scope.writePhotosAlbum | Whether the user has authorized saving images to their photo album. Corresponds to wx.saveImageToPhotosAlbum. |
boolean scope.camera | Whether camera access is authorized. Corresponds to the <camera /> component. |
Property | Type | Default value | Required | Description |
success | function | - | False | Callback function for successful API calls. |
fail | function | - | False | Callback function for failed API calls. |
complete | function | - | False | Callback function executed after API call ends (regardless of success or failure) |
Property | Type | Description |
authSetting | AuthSetting | User authorization result. |
wx.getSetting({success(res) {console.log(res.authSetting)// res.authSetting = {// "scope.userInfo": true,// "scope.userLocation": true// }}})
Property | Type | Default value | Required | Description |
success | function | - | False | Callback function for successful API calls. |
fail | function | - | False | Callback function for failed API calls. |
complete | function | - | False | Callback function executed after API call ends (regardless of success or failure) |
Property | Type | Description |
authSetting | AuthSetting | User authorization result. |
wx.openSetting({success(res) {console.log(res.authSetting)// res.authSetting = {// "scope.userInfo": true,// "scope.userLocation": true// }}})
wx.openSetting({success (res) {console.log(res.authSetting)// res.authSetting = {// "scope.userInfo": true,// "scope.userLocation": true// }}})
Property | Type | Default value | Required | Description |
scope | string | - | True | |
success | function | - | False | Callback function for successful API calls. |
fail | function | - | False | Callback function for failed API calls. |
complete | function | - | False | Callback function executed after API call ends (regardless of success or failure) |
// You can query whether the user has authorized the scope of "scope.record" using wx.getSetting.wx.getSetting({success(res) {if (!res.authSetting['scope.record']) {wx.authorize({scope: 'scope.record',success() {// Once the user has granted permission for the mini program to use the recording feature, subsequent calls to the wx.startRecord API will not prompt the user for permission again.wx.startRecord()}})}}})
Feedback