手机不开wifi,只开移动数据的情况下,调用wx.getLocation获取定位信息失败,如何处理?

小程序 文章 2021-01-28 09:21 1399 0 全屏看文

AI助手支持GPT4.0

手机不开wifi,只开移动数据的情况下,调用wx.getLocation获取定位信息失败,如何处理?What should I do if calling wx.getLocation to obtain location information fails when the phone does not open wifi but only uses mobile data?

手机不开wifi,只开移动数据的情况下,调用wx.getLocation获取定位信息失败,如何处理?

我们的小程序是租车业务,用户在租车时需要获取用户借车的实时精确定位,通过手动输入位置的方式会和用户实际定位产生比较大的偏差。实际场景中,用户在外用车都是连移动数据,但是这种情况下调用wx.getLocation获取定位信息是获取不到的,为什么微信API一直没有兼容在移动数据下获取定位的问题?作为小程序开发者,应该怎么处理这种问题?

Our small program is car rental business, users need to get the real-time accurate positioning of the user's car when they rent a car, and there will be a big deviation between the manual input of the location and the user's actual positioning. In the actual scene, the user uses the mobile data in the external vehicle, but in this case, the user calls the mobile data wx.getLocation It is impossible to obtain location information. Why has wechat API not been compatible with the problem of obtaining location under mobile data? As a small program developer, how to deal with this problem?

回答:

brave:

调用wx.getLocation获取定位信息失败 跟网络是wifi和移动数据有啥关系?无非就是要么信号差网络太差,要么就是小程序拒绝位置信息授权,或者就是小程序授权了,手机没有开启位置信息定位的开关。

Ps: 别人开移动数据定位也都正常,不要甩锅给微信。

Misa:移动数据5G情况下
何小强:

如果是5G手机,就算打开手机GPS定位,打开小程序位置授权同样会出现定位失败的情况。

但是只要切换成4G网络就可以获取定位信息。

希望官方能重视一下,能不能对5G手机做一下适配,大部分机型都是华为手机。

Misa:对的,我的也是5G,OPPO的,不开wifi就一直会出现定位失败的情况,调用API会报
“errCode: 2 ,errMsg: getLocation:fail:ERROR_NOCELL&WIFI_LOCATIONSWITCHOFF”,用户在户外,还要求用户打开wifi开关,这样不是太好。
小黎:

怎么可能没有兼容在移动数据下获取定位的问题,你的意思是开wifi就可以?亮代码看看

-EOF-

AI助手支持GPT4.0


国内超级便宜服务器

摸鱼人热门新闻聚合

钻级赞助商 我要加入

开发者在线工具

第三方支付技术请加QQ群

相关文章
获取电话号码的底部弹框动作怎样延迟执行?
小程序现在登陆之后获取到的加密信息解码之后也获取不到openid 和unionid 了??
急!累计独立访客(UV)已过1000,无违规情况,但是流量主开通还是显示灰色?anxious! The cumulative number of unique visitors (UV) has exceeded 1000 and there is no violation, but the traffic master is still displayed in gray?
如何将服务号的客服功能转接到企业微信?
应用类目里没有符合我的怎么办?
随便看看
调用convert_to_userid接口将openid转userid时返回错误码43004 1027
企业微信的应用不能自定义导航栏的颜色吗?跟品牌色不融入真的不是很好 1576
微信的服务通知,如何点击后直接打开H5页面,如下视频? 890
外部联系人是否可以通过接口添加企业用户? 672
同一个客户被企业多个员工添加,该客户被多次打扰的问题如何解决? 940
第三方服务商获取不同企业的外部联系人id是否唯一,是否会出现重复情况? 941
企业微信内部应用授权登录出现api freq out of limit, hint 5155
sendChatMessage发送消息失败,报错fail_nopermission 5032
企业微信外部客户拉黑后,建议在外部客户详细接口中增加状态字段 749
JSSDK 在 MAC 客户端与 iOS 客户端均初始化失败 (昨天开发时是正常的,未修改任何参数) 1680