After playing around with the NetworkExtension in order to get my app connected to a WiFI AP, I found out something that really bothers me.
Although I have set the JoinOnce property as „true“, after I terminate my application, my iPhone SE (iOS 12.2) remains connected to the access point. Apple's developer documentation states the following:
„
joinOnce
Restricts the lifetime of a configuration to the operating status of the app that created it.
SDK
iOS 11.0+
Framework
NetworkExtension
On This Page
Declaration
Discussion
See Also
Declaration
var joinOnce: Bool { get set }
Discussion
Optional. When joinOnce is set to true, the hotspot remains configured and connected only as long as the app that configured it is running in the foreground. The hotspot is disconnected and its configuration is removed when any of the following events occurs:
• The app stays in the background for more than 15 seconds.
• The device sleeps.
• The app crashes, quits, or is uninstalled.
• The app connects the device to a different Wi-Fi network.
• The user connects the device to a different Wi-Fi network.
To disconnect the device from a hotspot configured with joinOnce set to true, call removeConfiguration(forSSID:).
„
From what I have understood, if the JoinOnce is set, by all means should the application disconnect from the access point automatically and delete the entry inside the iOS Wifi Network Manager - at least upon termination of the App that used the NEHotspotConfiguration .
JoinOnce sounds like something really handy for my application logic - and that is why I want to use it instead of doing manual disconnect workarounds...