关于用户拒绝授权后,重新授权的问题
发布于 6 年前 作者 xia29 12510 次浏览 来自 问答

1、用户第一次进来,弹出获取位置信息的授权窗口,用户拒绝,进入fail


wx.getLocation({

   type: 'wgsS84',
   success: function (res) {},
   fail:function(){}

})


    第一次进来点  允许,安卓也是进到fail

2、当用户点击按钮,res.detail.authSetting[“scope.userLocation”] ,true


<button open-type="openSetting" bindopensetting="getScopes">无法获取地理位置,点击授权获取button>


3、我在 getScopes 方法中重新使用 wx.getLocation

   不同结果

                       iPhone 6s Plus

                       iOS 11.4

                       6.7.0

                       2.2.0 [146]

                       进入 success

 

                       魅族PRO 5armeabi-v7a

                       

                       6.6.7

                       2.2.0 [146]

                       进入 fail


wx.getLocation({

   type: 'wgsS84',
   success: function (res) {},
   fail:function(){}

})


求解答,蟹蟹~

3 回复

麻烦提供一下出现问题的机型和微信版本,并且给个相关的代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html),我们定位下问题

在 fail 回调中,请注意看一下 fail 的具体信息是什么(res.errMsg),这里不是没有权限的问题,而是“unsupported type”。是你的 type 写错了。

有没有人回答一下吖,在线等。。。。。。。。。。。。

回到顶部