我正在使用 ionic-3 开发混合
应用程序。我正在实现 google map
并尝试在我的应用程序中获取当前位置。 map 在 Android 和浏览器中工作正常,但当我在 ios 中构建它时,我收到权限错误。我已在 config.xml
config-file in Config.xml
<config-file file="*-Info.plist" mode="merge" target="NSLocationWhenInUseUsageDescription">
<string>To get your location and provide better service</string>
</config-file>
<config-file file="*-Info.plist" mode="merge" target="NSLocationAlwaysUsageDescription">
<string>To get your location and provide better service</string>
</config-file>
<config-file parent="NSCameraUsageDescription" target="*-Info.plist">
<string>need camera to take your profile picture</string>
</config-file>
I'm getting error as like below images
你能给我建议任何解决方案吗? 谢谢。
最佳答案
终于我找到了解决方案。 我只需要设置模拟器的当前位置。我会解释一下,也许对其他人有帮助。
- 在 iPhone 模拟器中运行项目
- 在调试菜单下,最后一个条目是“Location”;这会给你一个子菜单
- 选择“自定义位置”
- 设置您的位置。就是这样
关于ios - ionic 3 geolocation ios 中的位置错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56882847/