【问题标题】:Swift CLAuthorizationStatus always is CLAuthorizationStatus.NotDeterminedSwift CLAuthorizationStatus 始终是 CLAuthorizationStatus.NotDetermined
【发布时间】:2023-03-20 13:30:01
【问题描述】:

我希望我的应用程序获取用户的位置。 我从How to get Location user whith CLLocationManager in swift?的正确答案做了所有事情 但 CLAuthorizationStatus 始终是 CLAuthorizationStatus.NotDetermined 有什么问题?

【问题讨论】:

  • 你解决了吗?
  • 是的。首先在 plist 文件中添加这两行 1) NSLocationWhenInUseUsageDescription 2) NSLocationAlwaysUsageDescription - 来自我的问题中的链接
  • 自己解决了...我在plist 中为我的测试用例添加了两个键,而不是我的应用程序的plist

标签: swift cllocationmanager


【解决方案1】:

小心点

NSLocationAlwaysUsageDescription

NSLocationWhenInUseUsageDescription

键是强制性的,因此您应该将其包含在您的 plist 中。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2014-07-24
    • 2014-11-26
    • 1970-01-01
    • 2014-10-24
    • 2021-07-05
    • 2016-09-05
    • 2017-10-06
    • 1970-01-01
    相关资源
    最近更新 更多