HealthService User Experience
Your component can deliver any user experience you want, but there’s a common flow for any component that reads or writes health data.
- A Lightning web component displays a button, or another user interface control, to start a process that reads or writes weight data.
- When the user taps the button, HealthService requests permission to access the device’s health store the first time your component reads or writes data. The device’s health platform, Apple HealthKit or Android Health Connect, manages the permission experience.
- After the user grants permission, HealthService reads the requested weight records or writes the new weight record to the device’s health store.
- Your Lightning web component receives the weight records that it read, or a confirmation that the write succeeded. Your component can then display the data, add it to a Salesforce record, or apply whatever custom logic your business process requires.