离子地理位置,iOS上没有权限

时间:2018-01-30 04:06:01

标签: ios ionic-framework ionic2 cordova-plugins

我一直试图让地理位置包在过去的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

3 个答案:

答案 0 :(得分:2)

每次推出时都会删除@dhanesekar解决方案 - ion 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>

之后:离子cordova平台删除ios ---&gt;离子cordova平台添加ios

答案 1 :(得分:0)

将NSLocationWhenInUseUsageDescription添加到.plist。  打开/platforms/ios/{project}/{project}-Info.plist并添加以下内容:

<key>NSLocationWhenInUseUsageDescription</key>
<string>[App Name] would like to access your location when running and displayed.</string>

答案 2 :(得分:0)

我遇到了同样的问题,我跟随this git doc并最终获得了成功。