Slow programmatically connect to Wi-Fi Network

Hi,


I'm working on a accessory that my company produces (the product is already selling), and we're constantly getting complains from the users about some problems on the iOS version.


Basically our accessory produces an AccessPoint and the App needs to connect to this wifi network in order to send some commands. Because of the envirorment in witch the accessory operates it cannot have an Internet connectivity, neither can connect to an esisting AccessPoint because it's too far away and it would be to costly to bring connectivity to such an envirorment.


The App is Available on both Android and iOS. But while on Android the time the app takes to connect and send a command is at maximum 2 seconds(sometimes is instantaneous), on the iOS version it always takes 7-8 seconds and the user also has to give the permission to programmatically connect to the AccessPoint.


We are using the NEHotspotConfiguration interface, and the combo of permission popup and 7-8 seconds needed to connect and send the command makes the App higly impractible to be used.


Is there any way to either 1) don't ask for user permission every time we want to connect to the AccessPoint, or/and 2) make the connection faster ?


I know that the reason for the user permission is related to privacy issues but i see no reason why the connection should take forever once the user has given the permission (it takes 7-8 seconds from the moment the user gave it's permission).


This issue is really important, thank you in advance for any support.


Best regards,

Replies

Even though it may not have a solution, it'll be nice to have at least a feedback on this matter.

Thank you in advance for any support.


Best regards,

Anyone?

not a single reply..

not a single reply..

Indeed. I’ve been buried in WWDC stuff these past few weeks. However, I need to set some expectations here. DevForums is not a formal support channel. Apple has formal support channels — for code-level questions there’s \my organisation, DTS, and for system-level questions there’s AppleCare — and if you want a guaranteed response you should afford yourself of those services.

With that out of the way, let’s look at your specific questions. You wrote:

Is there any way to either 1) don't ask for user permission every time we want to connect to the AccessPoint

No.

2) make the connection faster ?

Again, setting expectations here, the interaction between iOS and a Wi-Fi access point is not governed by API but is a built-in system behaviour. Such behaviour is supported by Apple Support, not by DTS.

Having said that, I can offer some general advice, namely, you should profile this setup time to see what’s taking up the time.

Joining a Wi-Fi network is a multi-stage operation:

  1. The device must first join the Wi-Fi network itself.

  2. It then has to acquire IP addresses, both IPv4 and IPv6.

  3. It then invokes the captive network subsystem.

  4. Once that’s all done, the interface becomes active from the perspective of apps.

There are two ways to get insight into this process:

  • Packet trace — You can use an RVI packet trace to see what’s going on at the TCP/IP level, or a lower-level Wi-Fi packet trace to see what’s happening at the Wi-Fi level. See Recording a Packet Trace for info on both of these.

  • System log — Each of these subsystems has extensive logging that provides detailed insight into their operation.

Once you know what’s taking the time, that might suggest an alternative, faster approach. For example, if the system is taking a long time to acquire an IPv4 address from DHCP, you may be able to communicate faster by using IPv6.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"