NEHotspotConfigurationmanager fails if Bluetooth is connected

NEHotspotConfigurationmanager fails if Bluetooth is connected on an iPhone or iPad.


im using code simular to the follwoing:


NEHotspotConfigurationManager.shared.apply(hotspotConfig) {[unowned self] (error) in

    if let error = error {
        self.showError(error: error)
    }
    else {
        self.showSuccess()
    }
}


This works each time if bluetooth is not paired to any device, but once it is, it fails every time.


Does anyone know a solution to this?


Thanks in advance

Accepted Reply

Does it fail with an error? What error is that?

Also, are you referring to Bluetooth PAN accessories? Or any Bluetooth accessory? For reference, I just did the following:

  1. I paired my AirPods to my iPad.

  2. I started playing music.

  3. I ran the NEHotspotConfiguration Sample.

  4. I used it to join a Wi-Fi network.

and it worked a treat. The app was able to join the Wi-Fi network and music playback continued throughout.

Share and Enjoy

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

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

Replies

Does it fail with an error? What error is that?

Also, are you referring to Bluetooth PAN accessories? Or any Bluetooth accessory? For reference, I just did the following:

  1. I paired my AirPods to my iPad.

  2. I started playing music.

  3. I ran the NEHotspotConfiguration Sample.

  4. I used it to join a Wi-Fi network.

and it worked a treat. The app was able to join the Wi-Fi network and music playback continued throughout.

Share and Enjoy

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

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

Hi Eskimo,


sorry the more I looked into this issue I discovered that the problem lay within my socket read. I needed to implement a poll to extend timeout time.

The bluetooth being active cause a longer delay.


Thanks again