离子地理位置,iOS上无权限

keo*_*oir 1 ios ionic-framework cordova-plugins ionic2

在过去的3个小时中,我一直在尝试使地理位置定位软件包正常工作,并决定寻求帮助,也许您可​​以看到我看不到的东西。

我已按照指示进行操作,无法在任何iOS设备上获取位置服务的许可。

config.xml

https://gist.github.com/keoir/90ea3b75fefed70495409fd5692ac5c0

Package.json

https://gist.github.com/keoir/285c4c04671f70c2473783052936af0d

app.component.ts

https://gist.github.com/keoir/2d09d7cc6956b507a47a59701f0e1aa2

小智 5

每次我跑时,@ dhanesekar的解决方案都会被删除ionic cordova build ios。为了解决这个问题,我在config.xml中添加了以下内容:

<edit-config file="*-Info.plist" mode="merge" target="NSLocationWhenInUseUsageDescription">
   <string>Get Position</string>
</edit-config>
<edit-config file="*-Info.plist" mode="merge" target="NSLocationAlwaysUsageDescription">
   <string>Get position</string>
</edit-config>
Run Code Online (Sandbox Code Playgroud)

之后 : ionic cordova platform remove ios && ionic cordova platform add ios