Will an iPhone reconnect automatically to a wifi network we connected to previously with joinOnce = false?

PLATFORM AND VERSION: iOS

Development environment: Xcode 15.3, macOS 14.7.1 (23H222)

Run-time configuration: iOS 18.3.1

DESCRIPTION OF PROBLEM:

Our app uses NEHotspotConfigurationManager with joinOnce set to false to connect to an IoT device's Wi-Fi hotspot. Later, we programmatically disconnect from this hotspot. We are wondering if, after this programmatic disconnection, there is a possibility that the iPhone will automatically reconnect to the hotspot (even when our app is not running). Does it matter if the hotspot's SSID is hidden or not? This concern arises because the iPhone is already familiar with the hotspot's network configuration. Our testing indicates that this does not happen, but we want to be certain. This is a behavior we do NOT want to occur.

We set joinOnce to false because we experience connectivity issues with the IoT device when joinOnce is true (there are several discussions in forums regarding issues with setting it to true).

Thank you.

Thanks.

Our testing indicates that this does not happen, but we want to be certain.

Well, very few things in life are certain (-: However, the expected behaviour of setting joinOnce is that the device will… well… join once.

NEHotspotConfigurationManager operates in one of two modes:

  • If you set joinOnce, it tells the Wi-Fi subsystem to join the network.

  • If you don’t set joinOnce, it saves a Wi-Fi configuration and then tells the Wi-Fi subsystem to activate that configuration.

So, if you set joinOnce then there’s no persistent state that’ll cause the device to join the network again.

Share and Enjoy

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

Thank you for repying however I don't quite understand your answer. We are NOT setting joinOnce. When you write

If you don’t set joinOnce, it saves a Wi-Fi configuration and then tells the Wi-Fi subsystem to activate that configuration.

does it mean there is a chance an iPhone might rejoin?

We are NOT setting joinOnce.

Oh, sorry, I misread your post.

Back in your original post you wrote:

Later, we programmatically disconnect from this hotspot.

How are you doing that?

Share and Enjoy

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

How are you doing that?

By calling NEHotspotConfigurationManager's removeConfiguration with the ssid.

Hi,

I’m following up on my previous post. I haven't received a response yet and would greatly appreciate any assistance or guidance you can provide.

To summarize:

  • We are connecting to a hotspot using NEHotspotConfigurationManager and setting joinOnce to false
  • We are disconnecting programatically by calling NEHotspotConfigurationManager's removeConfiguration

The question is whether an iPhone might decide to connect by itself to the hotspot (even if the app is not running).

Thank you for your time and support.

Will an iPhone reconnect automatically to a wifi network we connected to previously with joinOnce = false?
 
 
Q