Forum Xamarin.iOS

Retrieving SSID and BSSID of wireless connected network

AntonPolimenovAntonPolimenov BGMember ✭✭
edited June 2017 in Xamarin.iOS

Hello,

I know this was discussed in many other topics, but still I can't make it working.

I'm using Visual Studio 2017 with Xamarin for VS 4.5.0.476, Xamarin.iOS 10.10.0.35, macOS 10.12.4, XCode 8.3.2.

From what I've read, both CaptiveNetwork.TryGetSupportedInterfaces(out interfaces) and CaptiveNetwork.TryCopyCurrentNetworkInfo("en0", out dict) should work, but I can't make it working. Both TryGetSupportedInterfaces and TryCopyCurrentNetworkInfo returns StatusCode.OK, but the out parameter value is null.

I read somewhere that these methods are not working on simulator, so I've tried this code on my iPhone 6s (ios 10.3.2), but they are still not working. I've also tried to build it in release and ad-hoc and the result is the same.

I've also read that I can use NetworkExtenstion (NEHotspotNetwork), but I need to acquire some privileges from Apple and I don't want to do that, since I should be able to get the information I need without it.

Can somebody help me find the way to make it working?

Thank you

Posts

  • BytesGuyBytesGuy GBXamarin Team Xamurai

    CaptiveNetwork was deprecated in iOS 9 for privacy reasons. NetworkExtension is the only replacement as far as I know, so you would have to go that route.

  • AntonPolimenovAntonPolimenov BGMember ✭✭

    Thank you for the quick response @BytesGuy.

    I read that information, but as far as I understand CaptiveNetwork is not deprecated anymore (from iOS 10). See this comment - https://stackoverflow.com/a/33132454.

Sign In or Register to comment.