IOS后台位置info.plist键名

Posted

技术标签:

【中文标题】IOS后台位置info.plist键名【英文标题】:IOS background location info.plist key name 【发布时间】:2018-06-13 14:31:45 【问题描述】:

ios 上请求位置权限时始终打开,一段时间后系统会向用户提示一个对话框,说 the app whats to use the location in the background 或类似的东西。

如何更改此对话框的描述? 是其中之一吗?

    <key>NSLocationWhenInUseUsageDescription</key>
    <key>NSLocationAlwaysUsageDescription</key>
    <key>NSLocationAlwaysAndWhenInUseUsageDescription</key>

【问题讨论】:

见Choosing the Authorization Level for Location Services Requesting Always Authorization Requesting When-In-Use Authorization @Honey 这不是很有帮助。如果用户在对话框位置权限中单击始终允许,则对话框会在一段时间后弹出。在第一个对话框中,我写信给用户please chose "always allow",当有背景的东西弹出时,我想写please chose "continue" 【参考方案1】:
    <key>NSLocationAlwaysUsageDescription</key>
    <string>This string is required to gain permission to access location services on iOS 8+ when the app in the background and should describe how your app uses location services. Set this string in the Info.plist</string>
    <key>NSLocationUsageDescription</key>
    <string>This string is optional but recommended on iOS 6 &amp; 7 and should describe how your app uses location services. Set this string in the Info.plist</string>
    <key>NSLocationWhenInUseUsageDescription</key>
    <string>This string is required to gain permission to access location services on iOS 8+ and should describe how your app uses location services. Set this string in the Info.plist</string>
    <key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
    <string>This string is required to gain permission to access location services on iOS 11+ and should describe how your app uses location services. Set this string in the Info.plist</string>

【讨论】:

以上是关于IOS后台位置info.plist键名的主要内容,如果未能解决你的问题,请参考以下文章

IOS 应用程序在添加时在 info.plist 中缺少目的字符串

GoogleService-info.plist 存储在 ios 应用程序的啥位置?

iOS 在后台监控用户位置。

带有地理位置网站的 Flutter iOS webview 应用程序不会询问位置权限,即使 info.plist 已调整

如何重建我的 Info.plist?

iOS9https设置info.plist