Why "would [my app] like to find and connect to devices on your local network"?

With iOS 14 there is a new privacy protection: Any attempt by an app to access the user's local network now causes a user to see an alert that the app "would like to find and connect to devices on your local network".

For instance, see an earlier thread on this:
https://developer.apple.com/forums/thread/654243

The rationale for this from Apple:
https://developer.apple.com/videos/play/wwdc2020/10110/

 According to Apple's presentation above:


If your app just accesses resources on the wide internet, you don't need to do anything different. You also don't need to update if you only interact with the local network using a system service, like AirPrint, AirPlay, AirDrop, or HomeKit.


These system services handle device discovery without exposing the full list of devices to apps. On the other hand, if your app accesses the local network directly within your app, either with unicast or multicast protocols, your app will require permission.


You'll also need to make a few simple updates to your app for iOS 14."

Fine, but my troubled app does not need any local network information. It does look for the user's location (which might use local network information?) and also accesses the internet. Another app of mine uses the same information to a much larger degree and is not causing any problem.

In Simulator (iPhone 11 Pro running iOS 14.0), my app does not appear on the list of "Apps that have requested permission to find and connect with devices ...". The app is running fine as expected. I cannot replicate the alert that is causing my app to be rejected. I don't know how to fix it!

Answered by DTS Engineer in 641078022

I just discovered that my app had "Application supports iTunes file
sharing" set to "YES" … Could that do it?

Unlikely.

Could a print command that never runs cause the app to go look for a
printer?

No, but even if it did that wouldn’t trigger the alert. This is covered in FAQ-2 of the Local Network Privacy FAQ.

In Simulator (iPhone 11 Pro running iOS 14.0), my app …

Are you only testing this on the simulator? If so, that’s not sufficient. See FAQ-12 of the above.

Most folks who unexpected hit this problem do so because they’ve linked in a third-party library that’s hitting the local network for some reason. If I were in your shoes I’d:
  1. Set up a test device running iOS 14.

  2. Reset the alert state (FAQ-13).

  3. Run and exercise its functionality to see if you can trigger the alert.

Once you can then you have some hope of debugging it.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@apple.com"
I just discovered that my app had "Application supports iTunes file sharing" set to "YES". No idea how that happened. I've turned it off.

Could that do it?

I can't reproduce the problem except by submitting another build for review.

[update] Another app of mine has the same setting turned on and there is no alert problem with that app. I gather it's a default setting.

I've also discovered that my troubled app contained some c code with print statements. That particular code never executes (and I've deleted it). Could a print command that never runs cause the app to go look for a printer?
Accepted Answer

I just discovered that my app had "Application supports iTunes file
sharing" set to "YES" … Could that do it?

Unlikely.

Could a print command that never runs cause the app to go look for a
printer?

No, but even if it did that wouldn’t trigger the alert. This is covered in FAQ-2 of the Local Network Privacy FAQ.

In Simulator (iPhone 11 Pro running iOS 14.0), my app …

Are you only testing this on the simulator? If so, that’s not sufficient. See FAQ-12 of the above.

Most folks who unexpected hit this problem do so because they’ve linked in a third-party library that’s hitting the local network for some reason. If I were in your shoes I’d:
  1. Set up a test device running iOS 14.

  2. Reset the alert state (FAQ-13).

  3. Run and exercise its functionality to see if you can trigger the alert.

Once you can then you have some hope of debugging it.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@apple.com"
Update: I've since installed iOS 14.0.1 onto my iPhone 7 Plus and it throws the same alert that is causing my app to be rejected in Review. And my app is then added to the list, in Settings, of apps that have asked for access to the Local Network.

I still have no clue why.

If I were in your shoes I’d:
Set up a test device running iOS 14.
Reset the alert state (FAQ-13).
Run and exercise its functionality to see if you can trigger the alert.

OK, I've done that and discovered that both my apps, once installed after updating to iOS 14, trigger the alert.

So, does accessing data on the web - in a URLSession or by using SafariServices - trigger the alert? The presentation implies that it does not but your (very useful) list leads me to wonder.

The only other thing I can think of is that both my apps determine the user's location. It seems like this should be handled fully by the location privacy setting?
SOLVED !!

I gave up trying to figure out what was triggering the alert. So to clear Review, I relented and added the info.plist item:

Privacy - Local Network Usage Description ...|... String ...|... "my text"

Guess what? That squelches the alert entirely! My alert text is never seen. My app is not added to the list of apps that have asked for Local Network access.

This fixed both of my affected apps.

Seems like a bug. Agreed?

That squelches the alert entirely!

That is very strange.

Seems like a bug.

Indeed. If you can attach two builds of your app, one with Info.plist string and one without, that’d be grand.

Share and Enjoy

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

Indeed. If you can attach two builds of your app, one with Info.plist string and one without, that’d be grand.

I've been traveling and only now saw your reply.

The working version is now available in the app store (as RIDS calc"). I'll be happy to provide a build with the string removed if you can detail what you mean by "attach".

if you can detail what you mean by "attach".

Attach to your bug report.

In the meantime we’ve iOS 14.2rc, which has a number of important local network privacy fixes. I recommend that you retry there before filing your bug.

Share and Enjoy

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

This was driving me crazy and it turned out to be Unity when it's set to Development Build. It will try to connect to the profiler and trigger this message on all Ad Hoc iOS builds.

Why "would [my app] like to find and connect to devices on your local network"?
 
 
Q