NEHotspotConfigurationManager.joinAccessoryHotspot

I'm using the NEHotspostConfigurationManager to join the WiFi network of a configured accessory.

While this is all nice and dandy, I wonder why I'm still connected to said WiFi when I (force-)close the app. Wouldn't it be more useful to reconnect to the last network before?

I'm using the NEHotspostConfigurationManager to join the WiFi network of a configured accessory.

While this is all nice and dandy, I wonder why I'm still connected to said WiFi when I (force-)close the app. Wouldn't it be more useful to reconnect to the last network before?

Are you setting "NEHotspotConfiguration.joinOnce = true"? The point of that setting is specifically that the device will disconnect from your hotspot when your app goes to the background. At that point the standard WiFi discovery logic takes over, which will then reconnect you to the "right" network based on the configured network priority.

__
Kevin Elliott
DTS Engineer, CoreOS/Hardware

joinAccessoryHotspot does not take a configuration parameter.

joinAccessoryHotspot does not take a configuration parameter.

Yes, but that's actually because it's "forcing" you into joinOnce. More specifically, what "joinAccessoryHotspot" basically does is:

  • Validate your access through ASAccessory.
  • Use the data in ASAccessory and the passphrase to construct an "NEHotspotConfiguration" object.
  • Set NEHotspotConfiguration.joinOnce = YES.
  • Applies that configuration.

Have you manually paired with this accessory before? If you also have a manual pairing, then I think you could get the behavior you're seeing. That is, your app's request causes the device to switch to your hotspot and the manual pairing means the device has no reason to disassociate. Have you tried testing with a different device, ideally a "clean" test device?

__
Kevin Elliott
DTS Engineer, CoreOS/Hardware

NEHotspotConfigurationManager.joinAccessoryHotspot
 
 
Q