NEHotspotConfigurationManager.apply() is not triggering.

Whenever I turn off Wi-Fi in the Setting.app, NEHotspotConfigurationManager.apply() doesn't get triggered.

If I restart my app, the apply function responds with
Error Domain=NEHotspotConfigurationErrorDomain Code=8 "internal error." UserInfo={NSLocalizedDescription=internal error.}
After restarting the device, this issue occurs again.

I observed this issue on iOS 16.6, and I'm not sure if it's the same on other versions.

Whenever I turn off Wi-Fi in the Setting.app, NEHotspotConfigurationManager.apply() doesn't get triggered.

Please clarify what you mean by “triggered” in this sentence. Normally folks use trigger to mean that something automatically perform an event in response to some criteria, but I don’t see how that applies here. The apply(…) method is something you call, not something that the system calls.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

NEHotspotConfigurationManager.apply(_:completionHandler:) had completionHandler on parameters.

However, the completionHandler may not be called after apply configuration when WiFi is turn off.

So, the sequence is:

  1. You turn off Settings > Wi-Fi.

  2. You launch your app.

  3. Your app calls apply(…).

  4. The completion handler is never called.

Is that right?

Can you reproduce this with NEHotspotConfiguration Sample?

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

So, the sequence is:

Yes.

Can you reproduce this with NEHotspotConfiguration Sample?

No. But I found that issue is cause by ssidPrefix + isWEP=false.

You can reproduce by modify NEHotspotConfiguration Sample as NEHotspotConfiguration(ssidPrefix: self.ssid, passphrase: password, isWEP: self.isWEP) on line 112 of HotspotManager.swift

tip:

  1. Issue only happen when first call apply(…)
  2. Issue can reproduce after reboot iPhone
NEHotspotConfigurationManager.apply() is not triggering.
 
 
Q