【问题标题】:HealthKit Authentication Error (Code = 3)HealthKit 身份验证错误(代码 = 3)
【发布时间】:2020-01-11 10:18:50
【问题描述】:

当我尝试在我自己的应用程序中验证访问权限以从入职时写入用户的正念分钟存储(健康应用程序)时,不会显示验证页面(尽管我在以前版本的应用程序中确实有此功能) .但是,该应用程序不会崩溃,并且调试器中只有以下消息:

错误域=com.apple.healthkit 代码=3“无法使用包标识符“com.myorg.myapp”查找源”UserInfo={NSLocalizedDescription=无法使用包标识符“com.myorg.myapp”查找源"}

我用来请求身份验证的代码如下:

let typesToShare = Set([
    HKObjectType.categoryType(forIdentifier: HKCategoryTypeIdentifier.mindfulSession)!
])

self.healthStore.requestAuthorization(toShare: typesToShare, read: nil) { (_, error) -> Void in
    if let error = error {
        print("\(error)")
    }

    DispatchQueue.main.async {
        self.performSegue(withIdentifier: "openWalkthroughThree", sender: self)
    }
}

我在互联网上搜索过,但似乎找不到任何有同样问题的人。我还检查了我对 HealthKit 的权利以及使用说明,但它们似乎都很好 - 正如我所说,我在我的应用程序的早期版本中使用了这个功能。

如果您能提供任何帮助以解决此问题,我将不胜感激。

【问题讨论】:

    标签: swift xcode healthkit


    【解决方案1】:

    不确定发生了什么,但只需重新启动我的设备即可解决此问题。

    另见:Missing HealthKit Entitlement

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-06-13
      • 1970-01-01
      • 1970-01-01
      • 2011-05-25
      相关资源
      最近更新 更多