首页 > 解决方案 > 用于跟踪位置的 NativeScript 地理位置设置目的消息

问题描述

我正在使用 nativescript-vue 和nativescript-geolocation插件。

Apple 不批准我的应用程序,因为我没有在向用户发送允许请求时指定地理跟踪的原因(参见示例): 在此处输入图像描述

据我所知,nativescript-geolocation 中没有这样的选项来更改该消息。

是否有任何其他方法可以更改此消息,或者我错过了 nativescript-geolocation 中的隐藏选项?

标签: nativescriptnativescript-vuenativescript-plugin

解决方案


参考插件自述文件,

对于 IOS 上的自定义提示消息,需要以下键: NSLocationAlwaysAndWhenInUseUsageDescription (iOS 11.0+) 或 NSLocationAlwaysUsageDescription (iOS 8.0-10.0) 和 NSLocationWhenInUseUsageDescription。阅读更多关于请求始终使用的信息。

您将在您的App_Resources/iOS/info.plist

<key>NSLocationWhenInUseUsageDescription</key>
<string>Your message here.</string>

推荐阅读