Open Apple Health programmatically

徘徊边缘 提交于 2019-12-05 04:10:18
patrickS

It looks like since iOS 10+ it is possible to open the Health app.

UIApplication.shared.open(URL(string: "x-apple-health://")!)

For details take a look at this

Stackoverflow post

The health permissions are opened only once automatically by the system at the time where you request the HealthKitStore for the right permissions. If the user refuses the permissions, you can not open them again. You could try to ask for an additional permission just to make the screen appear, but even if this might work I assume this is not what Apple intended with the default behaviour and might risk your app being refused.

There is no API to send the user to the Health app.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!