Get calories burnt from healthkit information

1. Go to symbols navigator, capabilities and switch on HealthKit.
2. Go to developer.apple.com, create an app ID with your correct bundle id gotten from your app. Indicate that it is an explicit app id and include healthkit in it.
3. Create a provisioning profile - App development - using the new app id created and download it.
4. Open xcode and import profile (sign-in profile). Select the provisioning profile you have just created.
5. Choose the new app id that you have just created.
6. Add the following to info.plist:
Privacy – Health Share Usage Description
Privacy – Health Update Usage Description
7. In the xcode swift file, import HealthKit

This code reads calories burnt and returns true or false depending on whether you are able to be authorised to read the data


Comments

Popular posts from this blog

Setting up a playground