Allowing your users to write their Prism body metrics data to Apple Health. This will enable users to track their health metrics within the Apple Health ecosystem.
The scope of these guidelines will cover:
Requirement | Details | Notes |
---|---|---|
Explainer screen for Apple Health Data Sync | - Shows up only for first time user experience. |
If the user skips, Apple Health sync will have to be turned on from the Profile Settings page.
Follow designs from Figma mocks. | | | Request authorization from user to write on HealthKit | - The app must request permission from the user to write data to Apple Health.
The app should handle cases where permissions are denied or restricted (list not fully toggled).
The app should load Apple’s authorization screen and include the explainer text as seen in the Figma mocks.
Request authorization to write specific data types using HKHealthStore
(HKHealthStore | Apple Developer Documentation) | Code will be available on Github repository. |
| Write body metrics data to HealthKit | - Prism body metrics data should be converted to the appropriate HKQuantitySample
types (HKQuantitySample | Apple Developer Documentation)
Metrics to be written to Apple Health:
a. Body Fat Percentage in the bodyFatPercentage
category.
b. Lean Mass in the leanBodyMass
category.
c. Waist Circumference in the waistCircumference
category.
d. BMI in the bodyMassIndex
category.
e. Height in the height
category.
f. Weight in the bodyMass category.
Write the data to Apple Health using HKHealthStore.save()
method.
Ensure that each data writing operation has a callback to handle success and failure.
Provide user feedback in case of failure and suggest potential resolutions (e.g., checking Health permissions) | Code will be available on Github repository. | | Implement the Apple Health Sync within the context of your App | - Implement the explainer and authorization screens for first time user experience only, just before the step where the user is asked to allow access to the camera (permission stage).
When authorization is granted, the app should write body metrics to Apple Health as part of the polling loop that checks for completed/failed scans. Once a new successful scan updates the results list screen, we should write the data to Apple Health for that scan.
Allow for enabling/disabling Apple Health sync from within the Profile Settings or similar screen (see Figma mocks):
If the user skips the Apple Health authorization screen during the first time user experience, then the toggle will be off and once toggled on the authorization screen should be displayed just like in the first-time user experience (including splash screen).
If the user has Apple Health sync toggle on and disables it, the writing of the data to Apple Health should stop, but the Authorization should not be revoked.
If the user has toggled Apple Health sync OFF, and then ON, the writing of data to Apple health will resume again in the same way as described above. There should be also be a popup or similar shown to the user with the following message: “You can enable access in the iOS Settings under Health -> Data Access & Devices -> Prism Body Scan.”
See Reference App flows on Figma. | |