Hi everyone,
We are working on an app that requires access to devices on the local network (Bonjour / LAN discovery + direct socket communication). We are currently struggling with the Local Network privacy permission flow introduced by Apple.
From our understanding, there is no dedicated public API to explicitly request Local Network permission or to reliably determine the current authorization state before attempting network activity.
We have tried several commonly suggested approaches to trigger the permission dialog, including:
Bonjour browsing via NWBrowser Publishing/listening with NetService UDP/TCP socket attempts on local subnet NWConnection / NWListener Triggering discovery after app launch and after foreground transitions
We already added the required entries in:
NSLocalNetworkUsageDescription NSBonjourServices
However, the behavior is inconsistent across devices and OS versions:
Sometimes the popup appears immediately Sometimes it never appears Sometimes network operations silently fail without callback clarity In some cases callbacks are delayed or ambiguous Reinstalling/resetting permissions changes behavior unpredictably
Our main challenges are:
What is currently considered the most reliable Apple-approved method to trigger the Local Network permission prompt? Is there any officially recommended way to determine whether permission is: not determined denied granted Is there any reliable callback or state transition API developers should use? Are there known differences between: NWBrowser NetService BSD sockets NWConnection when it comes to triggering the permission dialog? Are there recommended retry/timing patterns to avoid race conditions during app launch? Is Apple planning to introduce a dedicated authorization API similar to: AVAuthorizationStatus CLAuthorizationStatus PHPhotoLibrary.authorizationStatus()
Right now it feels difficult to provide a reliable UX because there is no deterministic way to:
proactively request access observe authorization state recover gracefully when the prompt does not appear
Any guidance, DTS references, WWDC sessions, or recommended implementation patterns would be greatly appreciated.
Thanks!