【发布时间】:2017-03-28 22:26:37
【问题描述】:
我正在使用 iPhone 4s 模拟器运行以下代码:
Ti.Geolocation.getCurrentPosition(function(e){
Ti.API.log(JSON.stringify(e));
});
上述输出的格式化版本提供以下信息:
{
"code": 0,
"type":"location",
"error":"The operation couldn’t be completed. (kCLErrorDomain error 0.)",
"source":{},
"success":true
}
似乎有相当矛盾的信息。它说success 是true 但给出了错误消息。
此外,根据Location Results Docs,它说如果成功为真,它应该返回一个coords 字段。然而上面没有coords。
还请注意以下两个返回 true 所以它不是权限问题:
Ti.Geolocation.locationServicesEnabled; Ti.Geolocation.hasLocationPermissions(Ti.Geolocation.AUTHORIZATION_ALWAYS);
【问题讨论】:
标签: ios titanium appcelerator appcelerator-titanium titanium-alloy