How to deal with local network changes (NSLocalNetworkUsageDescription) on iOS14 ?

Our application connects to a local WiFi (using TCPClient) for data communication purposes.
But in iOS 14 the connection fails completely because two processes take place at the same time:
  1. TCP client initialization

  2. Current network permissions.

So the connection to the local network is blocked until we reopen the application.

To avoid this, we're doing a hack: Pinging to a local IP address triggers the current network permissions (this is done in the OnAactivated() method of AppDelegate).
The connection only works properly if it is connected to that particular network otherwise it fails.

Has anyone faced this issue before?

Has anyone faced this issue before?

If your connection is not setting up properly to the local network then I would suspect there would be an issue with displaying the local network privacy prompt. If you need to associate to a local Wi-Fi you could also look at using NEHotspotConfiguration and NEHotspotConfigurationManager to associate to your network and then try your TCP connection.


Matt Eaton
DTS Engineering, CoreOS
meaton3@apple.com
How to deal with local network changes (NSLocalNetworkUsageDescription) on iOS14 ?
 
 
Q