ios - HealthKit HKAuthorizationStatus 读取数据

标签 ios ios8 healthkit

我正在使用 HealthKit 来阅读某些类型的信息。我特别不要求写入功能。当尝试检测用户是否允许读取某种健康类型时,问题就出现了。

我相信执行此操作的预期方法是使用 HKHealthStore 的 authorizationStatusForType 方法,但这只会被拒绝或未知返回。它只返回对 write 类型的授权。有没有人找到使用此方法进行阅读或其他解决方法的方法?

HKQuantityType *stepsType = [HKQuantityType quantityTypeForIdentifier:HKQuantityTypeIdentifierHeight];
HKAuthorizationStatus status = [self.healthStore authorizationStatusForType:stepsType];

最佳答案

出于隐私原因,您无法查看特定类型的应用程序的读取授权状态。

关于ios - HealthKit HKAuthorizationStatus 读取数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25512320/

相关文章:

ios - 在 iOS 8 模拟器上操作应用程序权限

ios - 显示 HealthKit 类型的名称

requestAuthorizationToShareTypes 方法在 iOS 8 Xcode 6 中不显示权限提示

ios - 更改 AVCaptureDeviceInput 导致 AVAssetWriterStatusFailed

ios - 如何在 swift 4 中获取数组索引的整数?

iOS Swift - 具有复杂数据关系的核心数据示例

iOS 应用因 healthkit 而被拒绝

ios - Swift 4 使用 AVPlayerViewController() 时无法同时满足约束条件

ios8 - UIAlertController 错误更改其他 UIImageViews 的 tintcolor

xcode - ios8 Swift - 转换 UIColor