HealthKit HKAuthorizationStatus用于读取数据 [英] HealthKit HKAuthorizationStatus for reading data

查看:954
本文介绍了HealthKit HKAuthorizationStatus用于读取数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I'm using HealthKit to read certain types of information. I'm specifically not asking for write functionality. The problem comes in when trying to detect if the user has allowed a certain Health type to be read.

我认为这样做的目的是使用HKHealthStore的authorizationStatusForType方法,但这只是被拒绝或未知。它仅返回写入类型的授权。有没有人找到一种方法来使用这种方法进行阅读或其他解决方法?

I believe the intended way to do this is using an HKHealthStore's authorizationStatusForType method, but this is only returned denied or unknown. It is only returning authorized for write types. Has anyone found a way to use this method for reading or another work around?

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


推荐答案

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

For privacy reasons, you are unable to view your application's read authorization status for a particular type.

这篇关于HealthKit HKAuthorizationStatus用于读取数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆