[英]HealthKit request authorization failing
I continue to receive this error when I request authorization.当我请求授权时,我继续收到此错误。
Error Domain=com.apple.healthkit Code=5 "Transaction block failed without an error."错误 Domain=com.apple.healthkit Code=5 “交易块失败,没有错误。” UserInfo={NSLocalizedDescription=Transaction block failed without an error.} UserInfo={NSLocalizedDescription=事务块失败且没有错误。}
I have tried re-adding and removing: Privacy - Health Update Usage Description
, Privacy - Health Records Usage Description
, Privacy - Health Share Usage Description
我已经尝试重新添加和删除: Privacy - Health Update Usage Description
, Privacy - Health Records Usage Description
, Privacy - Health Share Usage Description
I have tried removing the HealthKit entitlement and adding it again.我已尝试删除 HealthKit 权利并再次添加它。 This flow worked previously, so I have no idea what is going on.这个流程以前有效,所以我不知道发生了什么。 Deleting and reinstalling app does not fix the problem either.删除并重新安装应用程序也不能解决问题。
The HealthKit UI just never shows. HealthKit UI 永远不会显示。 Checking the privacy settings doesn't show I've ever requested either.检查隐私设置也没有显示我曾经请求过。
final class HealthStore {
private let healthStore = HKHealthStore()
func requestAuthorization() {
let objectTypes: Set<HKObjectType> = [
.activitySummaryType()
]
healthStore.requestAuthorization(toShare: nil, read: objectTypes) { (success, error) in
print("success = \(String(describing: success))")
print("error = \(String(describing: error))")
}
}
}
In a sample application this code works just fine.在示例应用程序中,此代码可以正常工作。 I think HealthKit has gotten into a bad state.我认为 HealthKit 陷入了糟糕的 state。
I don't know the underlying problem, but restarting my Mac and my iPhone solved the problem.我不知道根本问题,但重新启动我的 Mac 和 iPhone 解决了这个问题。
You change your IP and the network.您更改 IP 和网络。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.