Sahha SDK for Flutter Apps

The Sahha SDK provides a convenient way for Flutter apps to connect to the Sahha API.

Sahha lets your project seamlessly collect health and lifestyle data from smartphones and wearables via Apple Health, Google Health Connect, and a variety of other sources.

For more information on Sahha please visit https://sahha.ai.


Docs

The Sahha Docs provide detailed instructions for installation and usage of the Sahha SDK.

Sahha Docs


Example

The Sahha Demo App provides a convenient way to try the features of the Sahha SDK.

Sahha Demo App


Health Data Source Integrations

Sahha supports integration with the following health data sources:

& many more! Please visit our integrations page for more information.


Install

In the pubspec.yaml file, add the Sahha sdk to dependencies.

dependencies:
  # Sahha
  sahha_flutter: ^1.1.4

Android

In the AndroidManifest.xml file, which can be found in android > app > src > main, declare Google Health Connect data types if required, e.g. sleep and step count.

More data types are available such as heart rate, workout / exercise, please refer to the links below for more information.

<!-- Sleep -->
<uses-permission android:name="android.permission.health.READ_SLEEP" />

<!-- Activity -->
<uses-permission android:name="android.permission.health.READ_STEPS" />
<uses-permission android:name="android.permission.health.READ_FLOORS_CLIMBED" />

This is recommended if you'd like to retrieve Health Connect data from other health apps such as WHOOP, Garmin, Samsung Health etc.

To declare other sensor permissions, please refer to this page.

Only include the sensor permissions required by your project, what is declared here will be reviewed by the Play Store.

You must be able to justify reasons behind requiring the sensor permissions, these justifications may be used to clearly articulate the reasoning behind your required sensor permissions.

Apple iOS

Enable HealthKit

  • Open your project in Xcode and select your App Target in the Project panel.
  • Navigate to the Signing & Capabilities tab.
  • Click the + button (or choose Editor > Add Capability) to open the Capabilities library.
  • Locate and select HealthKit; double-click it to add it to your project.

Background Delivery

  • Select your project in the Project navigator and choose your app’s target.
  • In the Signing & Capabilities tab, find the HealthKit capability.
  • Enable the nested Background Delivery option to allow passive health data collection.

Add Usage Descriptions

  • Select your App Target and navigate to the Info tab.
  • Click the + button to add a new key and choose Privacy - Health Share Usage Description.
  • Provide a clear description, such as: "This app needs your health info to deliver mood predictions."

For more detailed instructions, refer to our setup guide.


API


Copyright © 2022 - 2023 Sahha. All rights reserved.

Libraries

sahha_flutter