question

JassimAlRahma-9056 avatar image
0 Votes"
JassimAlRahma-9056 asked WenyanZhang-MSFT commented

My app wants to connect to devices!!

Hi,

Why my app wants to connect to devices on the local network as you can see in the below screenshot? and how can I disable this?




143893-image.png


dotnet-csharpdotnet-xamarin
image.png (305.6 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

WenyanZhang-MSFT avatar image
0 Votes"
WenyanZhang-MSFT answered WenyanZhang-MSFT commented

Hello,

Welcome to our Microsoft Q&A platform!

This alert means that your app has triggered the Local Network Privacy. Apple adds a privacy setting related to local network usage in iOS 14.0, this alert can't be removed if your app do some operations required local network access. If you want to disable it, I 'm afraid you have to remove all operations about local network. It may not be used in your code, however, it will be used in some third-party tools.
In addition, your app needs to obtain the Privacy - Local Network Usage Description permission from the user to access the user's local network device, the default prompt is displayed as you provided, you could modify the description according to your business requirements. You could Open the info.plist in your iOS project, and add the following key

 <key>NSLocalNetworkUsageDescription</key>
 <string>xxxxxxxxxx</string>

For more information, you could refer to
https://stackoverflow.com/questions/63525026/what-triggers-the-would-like-to-find-and-connect-to-devices-on-your-local-netwo
Best Regards,
Wenyan Zhang


If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


· 6
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thanks..

But what kind of local operation you are talking about here?

I don't think I am connecting to any local because my app requires WiFi / Internet connection as my data are all on remote server.

0 Votes 0 ·

Network framework, BSD Sockets, NSStream, NSURLSession and WKWebView and some other lowest levels of networking APIs. You could check these common scenarios
https://developer.apple.com/forums/thread/663874

" Local network privacy provides added transparency when apps connect to devices on a person's home network. If your app interacts with devices using Bonjour or other local networking protocols, you must add support for local network privacy permissions in iOS 14 " , it is Apple's privacy policy and the explanation.
In addition, there is no such an API to check the access granted or not, this is related to Apple.

0 Votes 0 ·

but the first in the link is:

Making an outgoing TCP connection — yes

Does this mean any app which does HttpClient will get that message?

  • I don't have any Bonjour

0 Votes 0 ·
Show more comments