Skip to content

Commit

Permalink
chore: update doc and project info
Browse files Browse the repository at this point in the history
  • Loading branch information
exendahal committed Feb 3, 2024
1 parent b98816f commit dba7438
Show file tree
Hide file tree
Showing 5 changed files with 156 additions and 17 deletions.
16 changes: 9 additions & 7 deletions MAUIWifiManager/MauiWifiManager.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
For UWP update the version number with a version number you have installed.
-->
<AssemblyName>Plugin.MauiWifiManager</AssemblyName>
<RootNamespace>Plugin.MauiWifiManager</RootNamespace>
<PackageId>Plugin.MauiWifiManager</PackageId>
<RootNamespace>Plugin.MauiWifiManage</RootNamespace>
<PackageId>WifiManager.Maui</PackageId>

<Product>$(AssemblyName) ($(TargetFramework))</Product>
<AssemblyVersion>1.0.0.0</AssemblyVersion>
Expand All @@ -33,18 +33,18 @@
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageProjectUrl>https://github.com/exendahal/WifiManagerMAUI</PackageProjectUrl>
<RepositoryUrl>https://github.com/exendahal/WifiManagerMAUI</RepositoryUrl>
<PackageReleaseNotes>RELEASE NOTES</PackageReleaseNotes>
<PackageIconUrl>ICON URL</PackageIconUrl>
<PackageIcon>icon.png</PackageIcon>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageTags>xamarin, windows, ios, android, xamarin.forms, plugin, Wifi.Manager</PackageTags>

<Title>Wi-Fi Manager Plugin for MAUI</Title>
<Summary>Wi-Fi Manager Plugin for MAUI</Summary>
<Description>Wi-Fi Manager Plugin for MAUI</Description>


<Owners>Santsh Dahal</Owners>
<Authors>Santosh Dahal</Authors>
<Copyright>Copyright 2023</Copyright>
<Owners>exendahal</Owners>
<Authors>exendahal</Authors>
<Copyright>Santosh Dahal</Copyright>

<NeutralLanguage>en</NeutralLanguage>
<EnableDefaultCompileItems>false</EnableDefaultCompileItems>
Expand Down Expand Up @@ -76,6 +76,8 @@

<ItemGroup Condition=" '$(Configuration)'=='Release' And '$(OS)' == 'Windows_NT' ">
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" />
<None Include="docs\README.md" Pack="true" PackagePath="\" />
<None Include="images\icon.png" Pack="true" PackagePath="\" />
</ItemGroup>

<PropertyGroup Condition=" '$(Configuration)'=='Debug' ">
Expand Down
135 changes: 135 additions & 0 deletions MAUIWifiManager/docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
# Wifi Manager for MAUI

MAUI Wi-Fi Manager is comprehensive solution designed specifically for MAUI. This library empowers developers to effortlessly manage Wi-Fi networks within their cross-platform applications. With its intuitive APIs, you can seamlessly integrate Wi-Fi functionality, allowing users to connect to, add, and retrieve information about Wi-Fi networks with ease.


## Features

**Connect Wi-Fi with SSID and Password:** Enable users to connect to Wi-Fi networks by providing the SSID and password.

**Add a New Wi-Fi Network:** Seamlessly add new Wi-Fi networks to the device.

**Get Current Network Info:** Retrieve information about the currently connected Wi-Fi network.

**Disconnect Wi-Fi:** Allow users to disconnect from a Wi-Fi network.

**Open Wi-Fi Setting:** Provide a quick way for users to access their device's Wi-Fi settings.

## Getting started

### Initialization

Before using the MAUI Wi-Fi Manager plugin in your application, it's essential to initialize it. Here's how to do it on different platforms:

#### Android

To use the MAUI Wi-Fi Manager on Android, you must initialize the plugin. Add the following code to your Android application:

```csharp
WifiNetworkService.Init(this);
```

Android Permissions

```xml
<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 you request location before scanning Wi-Fi

#### iOS

Add wifi-info and HotspotConfiguration in Entitlements.plist

```xml
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.developer.networking.wifi-info</key>
<true/>
<key>com.apple.developer.networking.HotspotConfiguration</key>
<true/>
</dict>
</plist>
```

Request location permisson on info.plist

```xml
<key>NSLocationWhenInUseUsageDescription</key>
<string>App want to access location to get ssid</string>
```

Example

```csharp
PermissionStatus status = await Permissions.RequestAsync<Permissions.LocationWhenInUse>();
if (status == PermissionStatus.Granted)
{
var response = await CrossWifiManager.Current.ScanWifiNetworks();
}
else
await DisplayAlert("No location permisson", "Please provide location permission", "OK");
```

#### Connect to Wi-Fi

To connect to a Wi-Fi network programmatically, use the ConnectWifi method. This method takes the SSID and password as parameters. Here's an example:

```csharp
var response = await CrossWifiManager.Current.ConnectWifi(ssid, password);
```

The NetworkData class is defined as follows:

```csharp
public class NetworkData
{
public int StausId { get; set; }
public string? Ssid { get; set; }
public int IpAddress { get; set; }
public string? GatewayAddress { get; set; }
public object? NativeObject { get; set; }
public object? Bssid { get; set; }
public object? SignalStrength { get; set; }
}
```

#### Scan available Wi-Fi (Not available on iOS)

You can available Wi-Fi networks using the ScanWifiNetworks method:

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

#### Get Wi-Fi info

You can retrieve information about the currently connected Wi-Fi network using the GetNetworkInfo method:

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

#### Disconnect Wi-Fi

To disconnect from a Wi-Fi network, simply call the DisconnectWifi method with the SSID as a parameter:

```csharp
CrossWifiManager.Current.DisconnectWifi(ssid);
```

#### Open Wi-Fi Setting

If you want to provide users with a convenient way to access their device's Wi-Fi settings, use the OpenWifiSetting method:

```csharp
var response = await CrossWifiManager.Current.OpenWifiSetting();
```

I value your feedback! If you encounter any issues, have suggestions for improvement, or wish to report bugs, please open an issue on GitHub or GitLab repository
Binary file added MAUIWifiManager/images/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 6 additions & 6 deletions MauiWifiManager.sln
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,26 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.5.33424.131
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MauiWifiManager", "MAUIWifiManager\MauiWifiManager.csproj", "{F6BBDBED-2671-4BC8-AD4B-93DC5E3E710D}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DemoApp", "DemoApp\DemoApp.csproj", "{44458D82-6C21-4B4A-B29F-B8F85257CE43}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DemoApp", "DemoApp\DemoApp.csproj", "{44458D82-6C21-4B4A-B29F-B8F85257CE43}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MauiWifiManager", "MAUIWifiManager\MauiWifiManager.csproj", "{8A687AF0-600B-4107-B540-050E6099CAD1}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{F6BBDBED-2671-4BC8-AD4B-93DC5E3E710D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F6BBDBED-2671-4BC8-AD4B-93DC5E3E710D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F6BBDBED-2671-4BC8-AD4B-93DC5E3E710D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F6BBDBED-2671-4BC8-AD4B-93DC5E3E710D}.Release|Any CPU.Build.0 = Release|Any CPU
{44458D82-6C21-4B4A-B29F-B8F85257CE43}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{44458D82-6C21-4B4A-B29F-B8F85257CE43}.Debug|Any CPU.Build.0 = Debug|Any CPU
{44458D82-6C21-4B4A-B29F-B8F85257CE43}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
{44458D82-6C21-4B4A-B29F-B8F85257CE43}.Release|Any CPU.ActiveCfg = Release|Any CPU
{44458D82-6C21-4B4A-B29F-B8F85257CE43}.Release|Any CPU.Build.0 = Release|Any CPU
{44458D82-6C21-4B4A-B29F-B8F85257CE43}.Release|Any CPU.Deploy.0 = Release|Any CPU
{8A687AF0-600B-4107-B540-050E6099CAD1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8A687AF0-600B-4107-B540-050E6099CAD1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8A687AF0-600B-4107-B540-050E6099CAD1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8A687AF0-600B-4107-B540-050E6099CAD1}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
10 changes: 6 additions & 4 deletions workload-install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,16 @@ $ManifestBaseName = "Samsung.NET.Sdk.Tizen.Manifest"
$LatestVersionMap = @{
"$ManifestBaseName-6.0.100" = "7.0.101";
"$ManifestBaseName-6.0.200" = "7.0.100-preview.13.6";
"$ManifestBaseName-6.0.300" = "7.0.304";
"$ManifestBaseName-6.0.400" = "7.0.119";
"$ManifestBaseName-6.0.300" = "8.0.133";
"$ManifestBaseName-6.0.400" = "8.0.132";
"$ManifestBaseName-7.0.100-preview.6" = "7.0.100-preview.6.14";
"$ManifestBaseName-7.0.100-preview.7" = "7.0.100-preview.7.20";
"$ManifestBaseName-7.0.100-rc.1" = "7.0.100-rc.1.22";
"$ManifestBaseName-7.0.100-rc.2" = "7.0.100-rc.2.24";
"$ManifestBaseName-7.0.100" = "7.0.103";
"$ManifestBaseName-7.0.200" = "7.0.105";
"$ManifestBaseName-7.0.300" = "7.0.120";
"$ManifestBaseName-7.0.400" = "7.0.123";
"$ManifestBaseName-7.0.400" = "7.0.136";
"$ManifestBaseName-8.0.100-alpha.1" = "7.0.104";
"$ManifestBaseName-8.0.100-preview.2" = "7.0.106";
"$ManifestBaseName-8.0.100-preview.3" = "7.0.107";
Expand All @@ -51,7 +51,9 @@ $LatestVersionMap = @{
"$ManifestBaseName-8.0.100-rc.1" = "7.0.124";
"$ManifestBaseName-8.0.100-rc.2" = "7.0.125";
"$ManifestBaseName-8.0.100-rtm" = "7.0.127";
"$ManifestBaseName-8.0.100" = "7.0.129";
"$ManifestBaseName-8.0.100" = "8.0.130";
"$ManifestBaseName-9.0.100-alpha.1" = "8.0.134";
"$ManifestBaseName-9.0.100-preview.1" = "8.0.135";
}

function New-TemporaryDirectory {
Expand Down

0 comments on commit dba7438

Please sign in to comment.