flutternetwork / WiFiFlutter

Flutter plugin suite for various WiFi services.
https://wifi.flutternetwork.dev
290 stars 182 forks source link

[HELP] Making multiple requests in AP + STA mode #408

Closed Bojan227 closed 1 month ago

Bojan227 commented 1 month ago

Hey there, I have an iot device whis is used as access point, Im connection to the iot device with the code bellow and I need to make multiple requests to confirm some credentials, but after making one request my wifi network switches from iot AP to my home network.

Tested on Android

Is there a way to prevent switching back to home network?

Future<bool> handleDeviceConnection(ConnectionInfoDto connectionInfoDto) async {
  final response = await WiFiForIoTPlugin.connect(
    connectionInfoDto.ssid.trim(),
    joinOnce: true,
    withInternet: false,
  );

  if (!response) {
    return false;
  }
  return await WiFiForIoTPlugin.forceWifiUsage(true);
}