"Unable to join Wi-Fi" when using network extension API

Hello,


We are using NEHotspotConfigurationManager to connect to a GoPro camera. We instantiate NEHotspotConfiguration as indicated below and use the applyConfiguration API to automatically switch to the camera Wi-Fi.


let configuration = NEHotspotConfiguration.init(ssid:SSID, passphrase:password, isWEP: false)
configuration.joinOnce = false

NEHotspotConfigurationManager.shared.apply(configuration) { (error) in
    var message = "Joined Wi-Fi succefully!"
    if let err = error {
       message = "\(err)"
    }

    let alert = UIAlertController(title: nil, message: message, preferredStyle: .alert)
    alert.addAction(UIAlertAction(title: "Okay", style: .default, handler: nil))
    self.present(alert, animated: true, completion: nil)
}


Occasionally, calling the API fails without error and the "Unable to join Wi-Fi" alert shows up. It seems to us that this is caused by iOS not scanning when the the applyConfiguration is called. If this is correct, is there anything that we could do to trigger a scan from within the app?

If needed we have the sysdiagnose log that we can upload.

Thanks,

Glauco

Replies

If this is correct

I don’t know if this is correct but…

is there anything that we could do to trigger a scan from within the app?

… I’m quite sure that the answer to this is “No.” The

NEHotspotConfigurationManager
doesn’t give you any control over how ‘hard’ the system tries to join the target network. If it’s not working in some specific cases, your only option is to file a bug about that. Make sure to include the extra Wi-Fi diagnostics per the instructions on our Bug Reporting > Profiles and Logs page.

Please post your bug number, just for the record.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

Thanks Eskimo, I opened a bug and submitted all the instructed logs.


Bug number: 42913229

Hi,


We are also facing the same issue where NEHotspotConfiguration does not report any error but 'Unable to join the network...' error pops up when we try to connect to a WiFi network created by an IOT device. Is there any activity on the bug you reported?


Regards,

Anutosh.

  • Hello,

    I am facing the same issue. Was there any solution provided for this?

    Regards, Mayank

Add a Comment