Skip to content

.NET MAUI Wi-Fi Manager simplifies Wi-Fi management in cross-platform apps. With its APIs, you can easily connect to, manage, and retrieve Wi-Fi network information.

License

Notifications You must be signed in to change notification settings

exendahal/maui_wifi_manager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Wi-Fi Manager for .NET MAUI

The Wi-Fi Manager for .NET MAUI is a simple and powerful library that helps you manage Wi-Fi networks in your cross-platform apps. With this library, you can easily connect to Wi-Fi networks, retrieve network information, and provide quick access to Wi-Fi and wireless settings.

WifiManager.Maui


Supported Platforms

Platform Supported Notes
Android
iOS
Windows
Mac
Tizen

Key Features

  • Connect to Wi-Fi: Connect to Wi-Fi networks using SSID and password.
  • Get Network Info: View details about the currently connected network.
  • Disconnect Wi-Fi: Disconnect from a specific Wi-Fi network.
  • Open Wi-Fi Settings: Provide quick access to device Wi-Fi settings.
  • Open Wireless Settings: Provide quick access to device wireless settings.

How to Get Started

Initialization

Before using the library, make sure to initialize it properly:

For Android

Add the following to your Android app initialization:

WifiNetworkService.Init(this);

Also, include these permissions in your AndroidManifest.xml file:

<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />

Make sure to request location permissions before scanning for Wi-Fi.

For iOS

Add the following to your Entitlements.plist:

<key>com.apple.developer.networking.wifi-info</key>
<true/>
<key>com.apple.developer.networking.HotspotConfiguration</key>
<true/>

In Info.plist, request location permissions:

<key>NSLocationWhenInUseUsageDescription</key>
<string>The app needs location access to detect Wi-Fi networks.</string>

Examples

Connect to Wi-Fi

To connect to a Wi-Fi network:

var response = await CrossWifiManager.Current.ConnectWifi("your-SSID", "your-password");

Scan for Available Networks

To get a list of available Wi-Fi networks (Android & Windows only):

var response = await CrossWifiManager.Current.ScanWifiNetworks();

Get Current Network Info

To retrieve details of the currently connected Wi-Fi network:

var response = await CrossWifiManager.Current.GetNetworkInfo();

Disconnect Wi-Fi

To disconnect from a Wi-Fi network:

await CrossWifiManager.Current.DisconnectWifi("your-SSID");

Open Wireless Settings

To open the device's wireless settings:

await CrossWifiManager.Current.OpenWirelessSetting();

Note: On iOS, this opens the app's settings instead of wireless settings.


Open Wi-Fi Settings

To provide quick access to Wi-Fi settings:

await CrossWifiManager.Current.OpenWifiSetting();

Note: On iOS, this opens the app's settings instead of Wi-Fi settings.


Feature Support by Platform

Feature Android iOS Windows Notes
Connect to Wi-Fi Supported on all platforms.
Get Current Network Info Supported on all platforms.
Disconnect Wi-Fi Supported on all platforms.
Scan for Available Wi-Fi Networks Not supported on iOS.
Open Wireless Settings ✅* *Opens app settings on iOS.
Open Wi-Fi Settings ✅* *Opens app settings on iOS.

Feedback & Issues

If you encounter any issues or have suggestions, please open an issue on the project's GitHub repository.


License

This project is licensed under the MIT License. See the LICENSE file for details.

About

.NET MAUI Wi-Fi Manager simplifies Wi-Fi management in cross-platform apps. With its APIs, you can easily connect to, manage, and retrieve Wi-Fi network information.

Topics

Resources

License

Stars

Watchers

Forks

Languages