NEHotspotConfigurationManager internal error

I have tried everything to connect to a wifi hotspot programatically using NEHotspotConfigurationManager.applyConfiguration that people have suggested including adding the "Enable Hotspot" setting to the Entitlements.plist (and the App ID too) as well as enable wifi and network extension (content filter) settings just in case and none of this has fixed my problem with it returning "internal error". I've even tried rebooting my phone that I'm debugging to as that seems to be an issue for some people but that hasn't helped either. This is becoming quite frustrating so I hope some people have come across this as well and are able to help with this.
Yes, you will need the Hotspot Configuration capability enabled to use NEHotspotConfigurationManager.

as well as enable wifi and network extension (content filter) settings just in case and none of this has fixed my problem with it returning "internal error".

com.apple.developer.networking.wifi-info would be needed to check the SSID of the network you connected to, but not to use NEHotspotConfigurationManager. Including the content-filter capability to use NEHotspotConfigurationManager is not needed.

The best thing to do in this case is to check the logs of the access point or hotspot your device is associating with. That way you can see where the error is. Also check that you are not trying to send a network request too early after being associated. If you are using HTTP, try using the property waitForConnectivity before sending the dataTask with NSURLSession. If using NWConnection, check that the state of the connection is .ready.

If all else fails look at the Console.app logs when the connection fails on the device. This may give you something. For a deeper look, the WiFiManager log in the sysdiagnose will tell you more, as long as you have the Wi-Fi debugging profile installed.

Matt Eaton
DTS Engineering, CoreOS
meaton3@apple.com
NEHotspotConfigurationManager internal error
 
 
Q