.NET MAUI how to obtain Wifi/Connected network ip address of the device on iOs and Android?


How do we get the local device IP address (not the external IP address) in .NET MAUI on platforms iOS and Android?

The following answer specifies a solution for Android by using WifiManager.ConnectionInfo which Visual Studio clearly warns that the WifiManager.ConnectionInfo is obsoleted on Android 31 and higher;

Get IP address from Android and IOS Device using .NET MAUI

And the following GitHub page provides an example for iOS using NSNetService.Addresses. Again, Visual Studio states that NSNetService.Addresses is obsoleted on iOS 15 and higher and recommends using Network framework, but the documentation is mess and there aren’t any examples available;

https://gist.github.com/jbe2277/4b9f5ac0fb3556569960d2e1f3c5bf28

Latest articles

spot_imgspot_img

Related articles

Leave a reply

Please enter your comment!
Please enter your name here

spot_imgspot_img