Closed R1cs1KING closed 4 years ago
I am not sure about it, but I am not sure about in SwiftWifiIotPlugin.swift this method:
private func setEnabled(call: FlutterMethodCall, result: FlutterResult) { let arguments = call.arguments let state = (arguments as! [String : Bool])["state"] if (state != nil) { print("Setting WiFi Enable : \(((state ?? false) ? "enable" : "disable"))") result(FlutterMethodNotImplemented) } else { result(nil) } }
should result FlutterMethodNotImplemented
in the first case.
Same problem here, connect()
calls setEnabled(true)
which causes this issue. What is the best fix? I assume setEnabled(true)
shouldn't be called on iOS?
I have added PR #65 that does what @Niek mentioned. It solves the problem for me.
@Niek @R1cs1KING Please confirm by using my fork repo to test (check below snippet to do that) so that it can be merged.
dependencies:
flutter:
sdk: flutter
...
wifi_iot: #^0.1.1
git:
url: https://github.com/daadu/WiFiFlutter.git
Yep that's the fix @daadu
@alternadom Please merge.
I still have this problem on iOS14 emulator. The fix is present. What's wrong?
Edit: actually the message is different
MissingPluginException(No implementation found for method loadWifiList on channel wifi_iot)
Found this:
private func loadWifiList(result: FlutterResult) {
result(FlutterMethodNotImplemented)
}
sacn and getting wifi list is not possible in iOS (AFAIK)
Yes indeed, as I found out after posting. This baffles me but I'll find another way. Thanks for confirming!
I also have a problem. I am trying to connect wifi on iOS phone using wifi_iot library.
WiFiForIoTPlugin.connect(ssid, password: password, security: NetworkSecurity.WPA);
There is no MissingPluginException and it doesn't seem to publish any error.
But I can't connect to other wifi with my Phone. (Android works fine.) it returns always false.
Is there anyone to solve this issue?
@pyon123 Did you add proper entitlements (this part is missing in README) - Hotspot Configuration
and Access WiFi Information
?
@daadu Thanks for your kind reply. I am not sure I configure it successfully. This is all what I do.
it is working fine in Android 9.0. But not working iOS. My iOS version is 12.5.3. I made ESP32 device as an access point and trying to connect to that device with my phone. So no need to Hotspot configuration on my phone. Just want to access the device.
Please let me know your answer.
PS: Here is my project repository. (master branch). it is just simple for a testing. https://github.com/pyon123/ap_img_transfer_flutter
@pyon123 "Hotspot" in iOS is not "Accesspoint (Hotspot) in WLAN", is the underlying library name, that the package uses.
Additional setups, that are not documented in README, are as following, please follow them and let me know if it works.
It works for me. i added 3 them
I think the plugin no longer works on iOS.(flutter: Cannot get scanned results: CanGetScannedResults.notSupported) When I run the wifi scan sample code, I encounter such a message. You should update the documents, you are causing a lot of people to waste their time this way sir!!
Hi all! I have encountered an issue when I am trying to connect to WiFi on iOS (on Android it works). This is the error I get:
And this is the code I am using to connect:
WiFiForIoTPlugin.connect(ssid, password: password, security: NetworkSecurity.WPA);
Thanks for your help in advance!