i almost work well.
but when i try to connect with wrong passphrase, then i cannot connect with right passphrase.
i removed the ssid with removeConfiguration(forSSID) method, and getConfiguredSSIDs returns empty list.
but phone remember the first try of connection and i cannot correct the passphrase.
how can i correct passphrase or connect ssid?
here's my code using Completable of rxswift.
Completable.create { (emitter) in
let configuation = NEHotspotConfiguration(ssid: ssid, passphrase: password, isWEP: false)
configuation.joinOnce = true
NEHotspotConfigurationManager.shared.apply(configuation) { (error) in
if error != nil {
print("connect error:\(error)")
emitter(.error(error!))
} else {
let connectedWifi = SwiftWifiManagerPlugin.getConnectedWifiApName()
if (ssid == connectedWifi) {
emitter(.completed)
} else {
emitter(.error(WifiManagerError.wifiNotConnected))
}
}
}
return Disposables.create()
}.do(onDispose: {
NEHotspotConfigurationManager.shared.removeConfiguration(forSSID: ssid)
// NEHotspotConfigurationManager.shared.getConfiguredSSIDs { list in
// print("list:\(list)")
// }
})