WiFiFlutter icon indicating copy to clipboard operation
WiFiFlutter copied to clipboard

[HELP] Making multiple requests in AP + STA mode

Open Bojan227 opened this issue 1 year ago • 0 comments

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);
}

Bojan227 avatar Oct 21 '24 14:10 Bojan227