WiFiFlutter icon indicating copy to clipboard operation
WiFiFlutter copied to clipboard

[wifi_iot] On iOS `isEnabled` always return false and `getSSID` always return null.

Open mys10gan opened this issue 2 years ago • 3 comments

When running

bool wifiEnabled = await WiFiForIoTPlugin.isEnabled();

This is always false, even though WiFi is enabled and working.

And when running

String? wifiSSID = await WiFiForIoTPlugin.getSSID();

wifiSSID is always null, even though my device is connected.`

In the logs there's only 1 error: [] NEHotspotNetwork nehelper sent invalid result code [1] for Wi-Fi information request

Env Info:

iPhone se (iOS 15.7.3) Flutter version 3.7.7 Minimum OS version 11 Perms: Screenshot 2023-03-10 at 01 15 48

mys10gan avatar Mar 09 '23 20:03 mys10gan

  • getSSID will only work if the network is connected via app (this too is buggy from Apple's end - https://github.com/flutternetwork/WiFiFlutter/issues/166 ), else will require location permission.
  • isEnabled - there is no public API for this in iOS - we implement it by checking if SSID is null or not - therefore the above constraints remain

Hope this helps.

daadu avatar Mar 10 '23 03:03 daadu

Okay, thanks for informing. I'll figure something out with the available APIs.

mys10gan avatar Mar 10 '23 15:03 mys10gan