Plugin.Maui.NetworkMonitor 1.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package Plugin.Maui.NetworkMonitor --version 1.0.0
                    
NuGet\Install-Package Plugin.Maui.NetworkMonitor -Version 1.0.0
                    
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="Plugin.Maui.NetworkMonitor" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Plugin.Maui.NetworkMonitor" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Plugin.Maui.NetworkMonitor" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Plugin.Maui.NetworkMonitor --version 1.0.0
                    
#r "nuget: Plugin.Maui.NetworkMonitor, 1.0.0"
                    
#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.
#:package Plugin.Maui.NetworkMonitor@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Plugin.Maui.NetworkMonitor&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Plugin.Maui.NetworkMonitor&version=1.0.0
                    
Install as a Cake Tool

Maui.NetworkMonitor

Repository

MAUI library for Android and iOS that reports real internet availability, not just “connected to a network”.

It watches native path changes, classifies Wi-Fi vs cellular, and uses HTTP probes (plus Android captive-portal capabilities) to detect:

  • Validated public internet
  • Captive portals (hotel / airport / guest Wi-Fi sign-in)
  • Offline and local-network-only states
  • Wi-Fi ↔ mobile transitions

Install

dotnet add package Plugin.Maui.NetworkMonitor

Target frameworks shipped: net8.0, net9.0, and net10.0, with net9.0/net10.0 Android and iOS packs.

Usage

using Maui.NetworkMonitor;

public static class MauiProgram
{
    public static MauiApp CreateMauiApp()
    {
        var builder = MauiApp.CreateBuilder();
        builder.UseMauiApp<App>();

        builder.Services.AddNetworkMonitor(options =>
        {
            options.EnableHttpProbe = true;
            options.EnableCaptivePortalDetection = true;
            options.ReprobeInterval = TimeSpan.FromSeconds(30);
        });

        return builder.Build();
    }
}
public sealed class ConnectivityViewModel
{
    public ConnectivityViewModel(INetworkMonitor monitor)
    {
        monitor.StatusChanged += (_, e) =>
        {
            if (e.Current.IsCaptivePortal)
            {
                // Prompt the user to sign in.
            }

            if (e.IsTransportTransition)
            {
                // e.g. Wi-Fi → Cellular
            }
        };
    }
}

Manual use without DI:

using var monitor = NetworkMonitor.Create();
monitor.Start();
var status = await monitor.RefreshAsync();

What NetworkStatus tells you

Property Meaning
HasInternet Public internet was validated
IsCaptivePortal Sign-in page is intercepting traffic
Reachability Offline, LocalNetworkOnly, CaptivePortal, Internet
PrimaryTransport WiFi, Cellular, Ethernet, …
IsExpensive / IsConstrained Metered / Low Data Mode
ActiveTransports All transports on the current path

NetworkChangeKind.TransportChanged is raised for Wi-Fi ↔ cellular handoffs.

How detection works

  1. AndroidConnectivityManager.NetworkCallback plus NET_CAPABILITY_VALIDATED and NET_CAPABILITY_CAPTIVE_PORTAL.
  2. iOSNWPathMonitor for path status, Wi-Fi/cellular, expensive, and constrained flags.
  3. HTTP probes — known generate_204 / hotspot-detect endpoints. A 204 or expected success body is internet; a redirect, unexpected HTML, or TLS interception on a connected path is treated as a captive portal.

Probes use SocketsHttpHandler with redirects disabled so portal login pages are visible.

Permissions

The Android package declares:

  • INTERNET
  • ACCESS_NETWORK_STATE
  • ACCESS_WIFI_STATE

No extra iOS entitlements are required. Optional ATS exceptions for the HTTP probe hosts improve captive-portal accuracy if the OS blocks cleartext:

<key>NSAppTransportSecurity</key>
<dict>
  <key>NSExceptionDomains</key>
  <dict>
    <key>captive.apple.com</key>
    <dict>
      <key>NSExceptionAllowsInsecureHTTPLoads</key>
      <true/>
    </dict>
    <key>connectivitycheck.gstatic.com</key>
    <dict>
      <key>NSExceptionAllowsInsecureHTTPLoads</key>
      <true/>
    </dict>
    <key>www.msftconnecttest.com</key>
    <dict>
      <key>NSExceptionAllowsInsecureHTTPLoads</key>
      <true/>
    </dict>
  </dict>
</dict>

Pack

dotnet pack src/Maui.NetworkMonitor/Maui.NetworkMonitor.csproj -c Release -o artifacts

Sample

samples/Maui.NetworkMonitor.Sample is a MAUI Android/iOS app that shows live reachability, transport, and a change log.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-android35.0 is compatible.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-ios18.0 is compatible.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-android36.0 is compatible.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-ios26.0 is compatible.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Plugin.Maui.NetworkMonitor:

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.

Version Downloads Last Updated
1.0.7 95 9/2/2026
1.0.6 105 8/30/2026
1.0.5 95 8/30/2026
1.0.4 90 8/29/2026
1.0.3 104 8/28/2026
1.0.2 94 8/28/2026
1.0.1 107 8/28/2026
1.0.0 101 8/27/2026

Initial release: real internet probes, captive-portal detection, and Wi-Fi/cellular transition events for MAUI on Android and iOS.