【问题标题】:NSLocationWhenInUseUsageDescription inside library Info.plist库 Info.plist 中的 NSLocationWhenInUseUsageDescription
【发布时间】:2018-04-07 18:10:47
【问题描述】:

我已经构建了一个 Swift 库,它使用 CoreLocation 在应用程序正在使用时获取用户位置。如果我想将我的库集成到应用程序中,我只需要导入库,实例化我的类并启动获取用户位置的方法......

...而且我还需要在应用 Info.plist 中添加NSLocationWhenInUseUsageDescription

我想知道是否可以在库 Info.plist 中添加 NSLocationWhenInUseUsageDescription 以让程序员选择是实现自定义描述还是保留默认库描述。

附:我已经在 Info.plist 库中添加了 NSLocationWhenInUseUsageDescription,但是如果我决定不在应用程序 Info.plist 中添加它,Xcode 会不高兴:

This app has attempted to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSLocationWhenInUseUsageDescription key with a string value explaining to the user how the app uses this data

提前非常感谢!

【问题讨论】:

    标签: ios swift xcode core-location


    【解决方案1】:

    不,这是不可能的。

    您需要告知图书馆用户,他们需要将位置使用密钥添加到其应用的 info.plist。

    他们需要添加适合其应用使用位置的描述

    【讨论】:

      猜你喜欢
      • 2019-04-03
      • 1970-01-01
      • 2018-10-27
      • 2015-02-25
      • 2018-01-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-10-13
      相关资源
      最近更新 更多