Can I use NEHotspotConfigurationManager to prevent "The Wi-Fi network does not appear to be connected to the internet" prompt using Wi-Fi IoT Device

My users get a prompt that disrupts the use of my app.

The prompt comes more than 10 seconds into using a remote controlled IoT device via WiFi. The device is a drone, so it's not plausible to pause and it's absurd to have them wait so long for this prompt to appear to begin flight safely.

The Wi-Fi network "MySSID" does not appear to be connected to the Internet

Do you want to temporarily use cellular data?

Use Cellular Data

Keep Trying Wi-Fi

I connect with NEHotspotConfigurationManager https://developer.apple.com/documentation/networkextension/nehotspotconfigurationmanager

    hotspotConfig = NEHotspotConfiguration(ssid: mySSID)
    guard let hotspotConfig = hotspotConfig else {
      print("Error while connecting to WiFi")
      return
    }
    hotspotConfig.joinOnce = true
    NEHotspotConfigurationManager.shared.removeConfiguration(forSSID: ssid)
    NEHotspotConfigurationManager.shared.apply(hotspotConfig) { [self] (error) in
      if let error = error {
        print(self.handleConnectionError(error))
        completion(false)
      } else if self.wifiConnectionInfo() != nil {
        completion(true)
      } else {
        completion(false)
      }
    }

How do I prevent this? Or is there any workaround?

How do I prevent this? Or is there any workaround?

I am not aware of a way to workaround this. Generally this will happen when there is other network traffic trying to access the wider internet and it cannot reach the internet. This prompt is a system prompt. If your app controls other internet traffic trying to access the internet, and it is using an API like NWConnection, then you can try binding to the connection to the cellular interface for this traffic during this time to see if it has an impact. Take a look at requiredInterface.

Matt Eaton
DTS Engineering, CoreOS
meaton3@apple.com

I submitted a feature request to specify that a Hotspot connection will not be for Internet/Data.

What was the bug number?

Share and Enjoy

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

I submitted it on the Apple.com feedback page

If you log in you should be able to see a list of bugs that you’ve filed. Each entry has a subtitle that includes a bug number of the form FBnnnnnnn, where each n is a decimal digit.

Share and Enjoy

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

Can I use NEHotspotConfigurationManager to prevent "The Wi-Fi network does not appear to be connected to the internet" prompt using Wi-Fi IoT Device
 
 
Q