Plugin.Maui.AppHealth
1.0.0
See the version list below for details.
dotnet add package Plugin.Maui.AppHealth --version 1.0.0
NuGet\Install-Package Plugin.Maui.AppHealth -Version 1.0.0
<PackageReference Include="Plugin.Maui.AppHealth" Version="1.0.0" />
<PackageVersion Include="Plugin.Maui.AppHealth" Version="1.0.0" />
<PackageReference Include="Plugin.Maui.AppHealth" />
paket add Plugin.Maui.AppHealth --version 1.0.0
#r "nuget: Plugin.Maui.AppHealth, 1.0.0"
#:package Plugin.Maui.AppHealth@1.0.0
#addin nuget:?package=Plugin.Maui.AppHealth&version=1.0.0
#tool nuget:?package=Plugin.Maui.AppHealth&version=1.0.0
Plugin.Maui.AppHealth
Detect app, device, and environment problems in .NET MAUI on Android and iOS.
Instead of reading battery, storage, memory, thermal, and connectivity APIs in every feature, you inspect once and get a structured report:
- Overall status:
Healthy,Degraded, orUnhealthy - Findings with stable codes such as
battery.lowandnetwork.offline - Raw environment measurements for dashboards and support screens
- Optional watching so the app reacts when conditions change
Install
Package: https://www.nuget.org/packages/Plugin.Maui.AppHealth
dotnet add package Plugin.Maui.AppHealth
Or reference the project:
<ProjectReference Include="..\src\Plugin.Maui.AppHealth\Plugin.Maui.AppHealth.csproj" />
Target frameworks:
net10.0(unit tests / shared)net10.0-androidnet10.0-ios
Register the plugin
builder
.UseMauiApp<App>()
.UseAppHealth(options =>
{
options.EnableLogging = true;
options.LowBatteryPercent = 20;
options.CriticalBatteryPercent = 5;
options.LowStorageMegabytes = 512;
options.CriticalStorageMegabytes = 128;
options.HighMemoryPercent = 80;
options.CriticalMemoryPercent = 92;
options.WatchInterval = TimeSpan.FromSeconds(30);
// Optional: warn when the OS is older than your support policy.
options.MinimumAndroidVersion = new Version(8, 0);
options.MinimumIosVersion = new Version(16, 0);
// All check groups start enabled.
options.Checks.Thermal = true;
options.Checks.Network = true;
});
Resolve IAppHealth from dependency injection, or use AppHealth.Current.
Inspect now
var report = await AppHealth.Current.InspectAsync();
if (!report.IsHealthy)
{
foreach (var finding in report.Findings)
{
// finding.Code, finding.Severity, finding.Title, finding.Suggestion
}
}
if (report.Has(HealthCodes.NetworkOffline))
{
// Queue work until connectivity returns.
}
Limit the run to one or more groups:
await AppHealth.Current.InspectAsync(new InspectOptions
{
Only = [HealthCheckKind.Battery, HealthCheckKind.Network]
});
report.Environment includes charge percent, free storage, memory, thermal state, connectivity, device model, and app version.
Watch for changes
AppHealth.Current.HealthChanged += (_, e) =>
{
StatusLabel.Text = e.Current.Status.ToString();
};
AppHealth.Current.FindingChanged += (_, e) =>
{
foreach (var added in e.Added)
Log($"NEW {added.Code}");
};
AppHealth.Current.StartWatching();
Watching re-inspects when battery, energy saver, connectivity, thermal, or memory-warning events fire, and also on WatchInterval.
AppHealth.Current.StartWatching(new WatchOptions
{
Interval = TimeSpan.FromSeconds(15),
Only = [HealthCheckKind.Network, HealthCheckKind.Thermal]
});
Call StopWatching() when the page disappears.
What you get
| Check | Android | iOS | Typical findings |
|---|---|---|---|
| Battery | Charge, charging state | Charge, charging state | battery.low, battery.critical |
| Power mode | Battery Saver | Low Power Mode | power.energy_saver |
| Storage | App files volume | Documents volume | storage.low, storage.critical, storage.not_writable |
| Memory | ActivityManager low-memory |
Available process memory | memory.high, memory.pressure |
| Thermal | PowerManager (API 29+) |
NSProcessInfo thermal state |
thermal.fair, thermal.serious, thermal.critical |
| Network | Connectivity + airplane mode | Connectivity | network.offline, network.no_internet, network.airplane |
| Device | Model, OS, emulator | Model, OS, simulator | device.virtual, device.os_outdated |
| App runtime | Debugger | Debugger | app.debugger |
Status aggregation:
- Any critical finding →
Unhealthy - Otherwise any warning →
Degraded - Info findings do not change status
Stable codes live on HealthCodes so you can switch without parsing titles.
Host app setup
The plugin reads platform APIs. The host app should declare network state access on Android.
Android
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
Thermal status is available on Android 10 (API 29) and later. Older devices skip that signal.
iOS
No extra Info.plist keys are required for battery, storage, thermal, or connectivity.
Platform notes
| Android | iOS | net10.0 |
|
|---|---|---|---|
| Native signals | Yes | Yes | Test fakes |
| Airplane mode | Yes | Not exposed by iOS | Configurable |
| Low-memory flag | Yes | Memory warning events | Configurable |
| Simulator / emulator | Reported as device.virtual |
Same | No |
Sample
samples/AppHealth.Sample inspects the device, lists findings, and watches for changes.
dotnet build src/Plugin.Maui.AppHealth/Plugin.Maui.AppHealth.csproj
dotnet pack src/Plugin.Maui.AppHealth/Plugin.Maui.AppHealth.csproj -c Release
dotnet test tests/Plugin.Maui.AppHealth.Tests/Plugin.Maui.AppHealth.Tests.csproj
dotnet build samples/AppHealth.Sample/AppHealth.Sample.csproj -f net10.0-android
Pack
dotnet pack src/Plugin.Maui.AppHealth/Plugin.Maui.AppHealth.csproj -c Release
Packages are written to artifacts/.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-android21.0 is compatible. net10.0-browser was computed. net10.0-ios was computed. net10.0-ios15.0 is compatible. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Microsoft.Maui.Controls (>= 10.0.20)
-
net10.0-android21.0
- Microsoft.Maui.Controls (>= 10.0.20)
-
net10.0-ios15.0
- Microsoft.Maui.Controls (>= 10.0.20)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Plugin.Maui.AppHealth:
| Package | Downloads |
|---|---|
|
Plugin.Maui.Observability
Umbrella telemetry pipeline for .NET MAUI on iOS and Android. Unifies AppHealth, NetworkMonitor, ApiResilience, BackgroundTasks, OfflineSync, SmartUpload, and DeviceSession into one signal stream, and exports to OpenTelemetry, Application Insights, Sentry, Datadog, Console, or a custom HTTP endpoint. |
GitHub repositories
This package is not used by any popular GitHub repositories.
Initial release: inspect and watch battery, power mode, storage, memory, thermal, network, device, and app runtime problems on Android and iOS.