WeChat Open Platform

Mini Programs Documentation

Settings

wx.openSetting(OBJECT)

Calls the client's Mini Program Settings interface and returns the results of actions set by the user.

Object parameter descriptions:

Parameter Type Required Description
success Function No Callback function for successful interface call, refer to return parameter descriptions for return content
fail Function No Callback function for failed interface call
complete Function No Callback function for interface call results (will be executed if call succeeds or fails)

success return parameter descriptions:

Parameter Type Description
authSetting Object User authorization results, of which the key is the scope value and the value is the bool value, indicates whether the user is permitted to give authorization

scope descriptions:

scope Corresponding interface
scope.userInfo wx.getUserInfo
scope.userLocation wx.getLocation, wx.chooseLocation
scope.address wx.chooseAddress
scope.record wx.startRecord

Sample code:

wx.openSetting({
  success: (res) => {
    /*
     * res.authSetting = {
     *   "scope.userInfo": true,
     *   "scope.userLocation": true
     * }
     */
  }
})