WiFiFlutter icon indicating copy to clipboard operation
WiFiFlutter copied to clipboard

Autoconnection issue (does not switch from temporary connection to permanent connection.)

Open enverkc opened this issue 1 year ago • 4 comments

Hello , I am trying to connect a specific SSID when I open my app. But it stuck at temporary connection. So I cannot transfer data over it. When I open my app it ask the following question. image_2024-08-07_114103691 I accept this and and it says connected. But when I look to WiFi settings from my phone, it look like the following pic. image When I click to actual one, It connect to actual one and temporary WiFi disaperar. Has anyone experienced such a problem? Or can anyone help?

I tried many variantions of code but at the end , still same error. I am testing with Android 14

Thanks everyone.

My code like this:

` void _connectToWiFi() async { await WiFiForIoTPlugin.disconnect(); bool isConnected = await WiFiForIoTPlugin.connect( ssid, password: password, joinOnce: true, withInternet: false, security: NetworkSecurity.WPA, ); final res = await WiFiForIoTPlugin.forceWifiUsage(true);

if (isConnected) {
  print("Connected to $ssid");
} else {
  print("Failed to connect to $ssid");
}

}

@override Widget build(BuildContext context) { return Center( child: Text("Connecting to WiFi..."), ); } } `

enverkc avatar Aug 07 '24 09:08 enverkc