Plugin.Maui.NearbyConnectivity
Plugin.Maui.NearbyConnectivity provides the ability to discover, connect to, and exchange data with nearby devices that run your .NET MAUI application, without a server or an internet connection.
Get started API reference NuGet GitHub
Demo
The NearbyChat sample on three Android phones: two discoverers connect to one advertiser,
each phone stops advertising or discovering, each pair compares its authentication code, the
advertiser sends one peer a text and a photo, the other peer sends the advertiser a video, and
both peers disconnect. Recorded on real devices.
The video sent is a clip of Big Buck Bunny, (c) copyright 2008, Blender Foundation / www.bigbuckbunny.org, licensed under CC BY 3.0.
Supported platforms
| Target | Minimum | Support |
|---|---|---|
net10.0-android |
API 24 | Requires Google Play services. Built on Nearby Connections. |
net10.0-ios |
iOS 26.0 | Built on Multipeer Connectivity. |
net10.0 |
None | Reference target for shared code and unit tests. CheckAvailabilityAsync reports NearbyAvailability.Unsupported, and every start method throws. |
Important
A device connects only to devices on the same platform. Android connects to Android, and iOS connects to iOS. On iOS, the plugin stops the session when the app moves to the background. On Android, a connection ends when the process ends, so it survives the background only if your app runs a foreground service. See why the platforms do not interoperate and backgrounding.
Start here
Connect two phones, step by step
Fix something that is not working
Look up a type or a limit
Know what the plugin cannot do
Read a complete app
Install
dotnet add package Plugin.Maui.NearbyConnectivity
Android needs no manifest changes. iOS needs two Info.plist keys. See
Set up Android and iOS.
Then follow Get started, which takes about ten minutes.
Samples
The repository has two sample apps.
samples/Minimalis the app that the Get started tutorial builds. It is MAUI in code only, in four files plus the platform files.samples/NearbyChatis the larger app. The how-to pages link to the file that does each task:Task Page Answer a request before it expires Handle a request that expires Block sends until a person compares the code Compare the code Put an avatar in the presence Put structured data in the info Send a file, and handle each failure Send a file Receive in one loop for the whole app Receive data Bind connected devices, and rows with their own state Bind to a MAUI page Stay connected in the background on Android Keep a connection open in the background