本帖最后由 jansma 于 2017-1-6 13:34 编辑
使用 aMapLBS的singleAddress方法 在ios 自定义loader中崩溃(使用Ad Hoc证书),Android中使用正常 已经Config.xml中配置location的后台权限<preference name="backgroundMode" value="location"/>
崩溃情况: 第一次运行必崩,之后configManager就一直返回status false了,也不弹框提示请求定位权限
出现机型: ipad2 ios9.3.5 iphone6 ios10.2
这是我的代码
- var aMapLBS = api.require('aMapLBS');
-
- aMapLBS.configManager({
- accuracy: 'hundredMeters',
- filter: 1
- }, function(ret, err) {
- alert(JSON.stringify(ret))
- if (ret.status){
- aMapLBS.singleAddress({
- timeout: 5
- }, function(ret, err) {
- if (ret.status) {
- alert(JSON.stringify(ret))
- } else {
- alert("定位失败,请重试")
- }
- if (err) {
- alert("定位失败,请重试")
- }
- });
- }else{
- api.hideProgress()
- api.toast({
- msg: "检测到未开启定位,如已开启请重新点击,如未开启请至设置界面开启定位",
- duration: 4000,
- location: 'bottom'
- });
- }
-
- });
复制代码
|