Kebechet.Maui.Health
1.0.0-preview4
Prefix Reserved
dotnet add package Kebechet.Maui.Health --version 1.0.0-preview4
NuGet\Install-Package Kebechet.Maui.Health -Version 1.0.0-preview4
<PackageReference Include="Kebechet.Maui.Health" Version="1.0.0-preview4" />
paket add Kebechet.Maui.Health --version 1.0.0-preview4
#r "nuget: Kebechet.Maui.Health, 1.0.0-preview4"
// 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
Maui.Health
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
- in Google Play console give Health permissions to the app
- change of
AndroidManifest.xml
- change of min. Android version to v26
- 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 | Versions 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. |
-
net9.0-android35.0
- Microsoft.Maui.Controls (>= 9.0.0)
- Xamarin.AndroidX.Health.Connect.ConnectClient (>= 1.1.0-alpha07)
- Xamarin.AndroidX.Lifecycle.LiveData.Core (>= 2.8.7.2)
- Xamarin.AndroidX.Lifecycle.LiveData.Core.Ktx (>= 2.8.7.2)
-
net9.0-ios18.0
- Microsoft.Maui.Controls (>= 9.0.0)
-
net9.0-maccatalyst18.0
- Microsoft.Maui.Controls (>= 9.0.0)
-
net9.0-windows10.0.19041
- Microsoft.Maui.Controls (>= 9.0.0)
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