gpt4 book ai didi

ios - Health Kit 读取权限状态

转载 作者:搜寻专家 更新时间:2023-11-01 07:05:27 26 4
gpt4 key购买 nike

我正在开发一款与健康相关的应用程序。该应用程序的功能取决于健康和位置服务。我正在尝试访问健康数据权限(应用程序的某些部分将在没有健康数据权限的情况下受到限制)。我在互联网上搜索并阅读了苹果文档。我找到了一个函数

HKHealthStore().authorizationStatus(for: )

它将保存数据的状态返回到健康应用程序,但这对我不起作用。我只需要阅读权限。我如何访问这些信息?

非常感谢任何帮助。谢谢 :)

最佳答案

您无法确定您的应用是否具有读取访问权限。来自文档:

To help prevent possible leaks of sensitive health information, your app cannot determine whether or not a user has granted permission to read data. If you are not given permission, it simply appears as if there is no data of the requested type in the HealthKit store. If your app is given share permission but not read permission, you see only the data that your app has written to the store. Data from other sources remains hidden.

关于ios - Health Kit 读取权限状态,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48336135/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com