Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Open Apple Health programmatically

Tags:

ios

healthkit

Is it possible to open the Health app programmatically, like one can do with the Settings app?

If it's not possible to open the app's Apple Health permissions screen directly, can we at least open the main Apple Health screen?

Edit: I know that I cannot request permissions again - just like with other things like Camera access, etc. However, if the user refuses Camera permissions, I can direct them to the Settings page directly where they can change those permissions.

NSURL *url = [NSURL URLWithString:UIApplicationOpenSettingsURLString];
[[UIApplication sharedApplication] openURL:url];

Is there such a thing for Health App?

like image 556
SaltyNuts Avatar asked Jul 29 '16 15:07

SaltyNuts


People also ask

How do I access Apple Health API?

No, Apple Health does not have an API. As no data is stored in the cloud, you need to retrieve it locally from your users' devices. This can be done by implementing Apple HealthKit and all its data retrieval methods into your iOS.

Can you access Apple Health on PC?

Connect Apple Health to the PC Health app for the first time We'll ask if you want to connect Apple Health to the PC Health app the first time you enroll in a connected Health Program (a program with activities you can complete using Apple Health data).


1 Answers

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

like image 77
patrickS Avatar answered Oct 05 '22 10:10

patrickS