# wx.getSetting(Object object)
Start from base library version 1.2.0. Please remaining backward compatible.
Obtains the user's current settings. Only the permissions that have been requested by the Mini Program from the user are returned.
# Parameters
# Object object
Attribute | Type | Default | Required | Description |
---|---|---|---|---|
success | function | No | The callback function for a successful API call | |
fail | function | No | Callback function for failed API call | |
complete | function | No | Callback function used when API call completed (always executed whether call succeeds or fails) |
# object.success callback function
# Parameters
# Object res
Property | Type | Description |
---|---|---|
authSetting | AuthSetting | Results of user authorization |
# Sample Code
wx.getSetting({
success (res) {
console.log(res.authSetting)
// res.authSetting = {
// "scope.userInfo": true,
// "scope.userLocation": true
// }
}
})