vital_health 1.4.0 vital_health: ^1.4.0 copied to clipboard
The Vital Health package allowing fitness apps linking with tryvital.io and with support for HealthKit.
The Vital SDK is split into three main components:
- vital_core holds common
components to both
vital_devices. Among other things, it has the network layer that allows us to send data from a device to a server.
- vital_health is an abstraction over HealthKit an Health Connect(coming soon)
- vital_devices is an abstraction over a set of Bluetooth devices.
Getting Started #
- Follow iOS SDK instructions regarding HealthKit capabilities and background delivery setup for your iOS app.
- Follow Android SDK instructions regarding Health Connect capabilities setup for your Android app.
- To use Vital Health client you need to call configure first:
final HealthServices healthServices = HealthServices( apiKey: apiKey, region: region, environment: Environment.sandbox, ); await healthServices.configureClient(); await healthkServices.configureHealth(HealthConfig( iosConfig: IosHealthConfig( backgroundDeliveryEnabled: true, ), androidConfig: AndroidHealthConfig( syncOnAppStart: true, ), ));
- Set User ID
- Ask user for permissions to collect/write Health data.
healthServices.ask( [ HealthResource.profile, HealthResource.body, ... ], [ HealthResourceWrite.water, ... ] );
- Sync data
- Observe sync status using status stream
Stream<SyncStatus> status = healthServices.status;
- When your user logs out you need to call cleanup on the health service
For more example usage run the sample app with your API key and Region set in
Please refer to the official Vital docs provide a full reference on using
vital-flutter is available under the AGPLv3 license. See the LICENSE file for more info. VitalDevices is under
Adept Labs Enterprise Edition (EE) license (the “EE License”). Please refer to its license inside its folder.