AuthSetting
Some of the APIs need users’ authorization before they can be called. We have divided these APIs into multiple scope
according to the scope
of usage. The users can select scope
to authorize. After a scope
is authorized, all of its APIs can be used directly.
When such an API is called:
- If the user has not accepted or rejected this authorization, a pop-up window will appear to ask the user if he/she wants to accept. The API can be called only after the user clicks to accept;
- If the user has accepted authorization, the API can be called directly;
- If the user has rejected authorization, no pop-up appears. Instead, API fail callback will be accessed directly. Developers should make the scenario compatible where the user has rejected to authorization.
Methods
Property | Type | Required | Description |
---|---|---|---|
scope.address | boolean | No | Postal address. wx.chooseAddress |
scope.camera | boolean | No | Camera. [camera](https://developers.weixin.qq.com/miniprogram/dev/component/camera.html) component |
scope.invoice | boolean | No | Gets invoice. wx.chooseInvoice |
scope.invoiceTitle | boolean | No | Invoice title. wx.chooseInvoiceTitle |
scope.record | boolean | No | Recording feature. wx.startRecord |
scope.userInfo | boolean | No | User information. wx.getUserInfo |
scope.userLocation | boolean | No | Geographic location. wx.getLocation, wx.chooseLocation |
scope.werun | boolean | No | WeRun step counts. wx.getWeRunData |
scope.writePhotosAlbum | boolean | No | Saves to album. wx.saveImageToPhotosAlbum, wx.saveVideoToPhotosAlbum |