I’ve encountered an issue with an app that includes a Local Push Connectivity extension. After a fresh install of the app, the Local Network Alert appears when calling NEAppPushManager.save(). The alert message is:
“This app would like to find and connect to devices on your local network. This app will be able to discover and connect to devices on the networks you use.”
Here is the relevant code:
` pushManager.providerConfiguration = NEAppPushManager.providerConfiguration(with: settings, system: system)
if settings.ssids.isEmpty {
fatalError("☠️ The PushManagerSettings.ssids should NEVER be empty!")
}
pushManager.matchSSIDs = !settings.ssids.isEmpty
? Array(settings.ssids)
: []
return pushManager.save()`
Questions:
1. Why does the Local Network Alert appear?
I suspect it is related to pushManager.matchSSIDs, which interacts with the local network to match specific SSIDs. 2. What happens if the user clicks “Don’t Allow”? Based on my testing, everything seems to work fine even if the user denies the permission.
Would you happen to know why this is happening and if denying the alert could cause any issues down the line?
What happens if the user clicks “Don’t Allow”? Based on my testing, everything seems to work fine even if the user denies the permission.
Expanding on my earlier answer, "TN3179: Understanding local network privacy" has a much more complete overview of the alert and exactly what a denial would block. On the testing side, I would be careful about exactly what/how you're testing, as identical test cases ("Call another person") will succeed or fail because the network relationship between the two devices happened to involve an intermediate router. Note this recommendation in particular:
If your app allows people to enter an arbitrary network address, consider what happens if they enter a local network address.
Many voips handle calls by using a central server to exchange IP addresses, then having the two devices directly connect to each other. Functionally, that's the same as allowing users to enter arbitrary network addresses.
__
Kevin Elliott
DTS Engineer, CoreOS/Hardware