Kebechet.Maui.Health 1.0.0-preview4

Prefix Reserved
This is a prerelease version of Kebechet.Maui.Health.
dotnet add package Kebechet.Maui.Health --version 1.0.0-preview4                
NuGet\Install-Package Kebechet.Maui.Health -Version 1.0.0-preview4                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Kebechet.Maui.Health" Version="1.0.0-preview4" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Kebechet.Maui.Health --version 1.0.0-preview4                
#r "nuget: Kebechet.Maui.Health, 1.0.0-preview4"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Kebechet.Maui.Health as a Cake Addin
#addin nuget:?package=Kebechet.Maui.Health&version=1.0.0-preview4&prerelease

// Install Kebechet.Maui.Health as a Cake Tool
#tool nuget:?package=Kebechet.Maui.Health&version=1.0.0-preview4&prerelease                

"Buy Me A Coffee"

Maui.Health

NuGet Version NuGet Downloads

Abstraction around Android Health Connect and iOS HealthKit ⚠️ Beware, this package is currently just as Proof of concept. There is a lot of work required for proper stability and ease of use. Issues will contain future tasks that should be implemented.

Feel free to contribute ❤️

Usage

Firstly register package installer in your MauiProgram.cs

 builder.Services.AddHealth();

Then setup all Android and iOS necessities.

  • Android (3) docs, docs2
  • iOS (3) docs, docs2
    • generating new provisioning profile containing HealthKit permissions. These permissions are changed in Identifiers
    • adding Entitlements.plist
    • adjustment of Info.plist

After you have everzything setup correctly you can use IHealthService from DI container and call it's methods. If you want an example there is a DemoApp project showing number of steps for Current day

TIP

While you test your workflows on iOS your device sometimes doesnt have data necessary (e.g. number of steps is 0). In that case you can open Health app → find Steps → click on it → and in right top corner is Add data. This way you can manually add some testing data

Credits

  • @aritchie - https://github.com/shinyorg/Health
  • @0xc3u - https://github.com/0xc3u/Plugin.Maui.Health
  • @EagleDelux - https://github.com/EagleDelux/androidx.health-connect-demo-.net-maui
  • @b099l3 - https://github.com/b099l3/ios-samples/tree/65a4ab1606cfd8beb518731075e4af526c4da4ad/ios8/Fit/Fit

Other sources

Product Compatible and additional computed target framework versions.
.NET net9.0-android35.0 is compatible.  net9.0-ios18.0 is compatible.  net9.0-maccatalyst18.0 is compatible.  net9.0-windows10.0.19041 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.0-preview4 58 2/15/2025
1.0.0-preview3 40 2/14/2025
1.0.0-preview2 35 2/14/2025
1.0.0-preview1 30 2/13/2025

Fixed mac build