This post is part of the Local Network Privacy FAQ.
There is no API that directly returns your local network access state (r. 69157424).
There are, however, a number of techniques you can apply:
Back to the FAQ
How do I tell whether I’ve been granted local network access?
There is no API that directly returns your local network access state (r. 69157424).
There are, however, a number of techniques you can apply:
If you’re using Bonjour, you will get the kDNSServiceErr_PolicyDenied (-65570) error if your Bonjour operation failed because you don’t have local network access.
If your goal is to connect to a local network address using NWConnection then, starting with iOS 14.2 beta, you can use the unsatisfied reason property. See How do I use the unsatisfied reason property? for details.
Back to the FAQ