html52.com
我爱小程序-开发者交流社区

如何检测用户未打开位置信息开关?

如何检测用户未打开位置信息开关?

当用户关闭手机位置信息的时候,蓝牙是无法搜到周边设备的.

目前使用该

wx.getLocation 接口,但是安卓返回的错误码代表什么含义,能否文档说明下?

errCode 2 安卓返回是代表总开关未打开吗?

https://developers.weixin.qq.com/miniprogram/dev/api/location/wx.getLocation.html

elopers.weixin.qq.com/miniprogram/dev/api/location/wx.getLocation.html

网友回复

胖丫么胖:
检测不了,只能检测用户是否开启地理位置定位授权

wx.getSetting({
   success: res => {
     let authSetting = res.authSetting
          // 没有授权
     if (!authSetting['scope.userLocation']) {
              
     }
   },
   fail: () => {
      
   }
 })
11月:

wx.getSystemInfowx.getSystemInfo

看看这个接口满足你的需求不

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

真正的个人免签约支付接口

云免签H5支付