Small Authorization

Small Authorization

"" " 
. 1 as part of the functionality needed to use the agreed 

2 wx.getSetting to determine whether the user has no authorization for the interface, I determine which interface, it must pass to wx.getSetting corresponding scope values 
- a scope that corresponds to this value one or more interfaces 

3 If we re-wx.getSetting found scope value is false, logo without authorization, we may initiate the authorization by wx.authorize, authorization for that interface, give scope wx.authorize pass the corresponding value on it. If the user agrees to authorize, you can directly use the corresponding interface. 

4, but no way to use wx.authorize scope.userInfo bomb box automatically pops up the user must manually click the button evoke authorization bomb box. 
Code format: 
    <the button Open- type = "getUserInfo" bindgetuserinfo = " user1"> user information </ button> 
    we can then get the response function of the parameters in the user information .e.detail, the content and get a direct call wx.getUserInfo same. 
"" "

scope list

scope The corresponding interface description
scope.userInfo wx.getUserInfo User Info
scope.userLocation wx.getLocation, wx.chooseLocation Location
scope.userLocationBackground wx.startLocationUpdateBackground Background positioning
scope.address wx.chooseAddress mailing address
scope.invoiceTitle wx.chooseInvoiceTitle Invoice
scope.invoice wx.chooseInvoice Get invoice
scope.werun wx.getWeRunData Movement micro-channel number of steps
scope.record wx.startRecord recording function
scope.writePhotosAlbum wx.saveImageToPhotosAlbum, wx.saveVideoToPhotosAlbum save into the album
scope.camera camera assembly camera

Guess you like

Origin www.cnblogs.com/baohanblog/p/12483906.html