If your iPhone can browse the web but your app cannot find a printer, accessory or nearby Mac, check the app’s local network permission before changing discovery code. Internet access and permission to interact with a device on the local network are separate. A failed connection may also mean discovery did not find the service or the two devices cannot communicate on that Wi-Fi network.


Prove the failure on a physical device


Start with a known working service on a network you control. Put the iPhone and the device that hosts the service on the same ordinary Wi-Fi network and bring the app to the foreground. Trigger discovery through the same screen a customer would use. Record the device OS, build, service type and whether a permission alert appears. Apple recommends testing local network privacy on a real device because its behavior is not supported by the simulator.


In Settings → Privacy & Security → Local Network, look for the app and check whether access is enabled. An app may be absent before it attempts an operation that requires permission. If a Network framework connection enters the waiting state with localNetworkDenied as the unsatisfied reason, investigate permission before changing ports or reinstalling the accessory. Allow the user to retry after changing Settings and explain what granting access will let the app do.


Follow the evidence to the right fix


For a Bonjour browser, verify that the service type in the browser matches the service actually advertised. Declare the Bonjour types the app uses in NSBonjourServices and provide a meaningful NSLocalNetworkUsageDescription. A discovery declaration does not cause an accessory to advertise. If your app sends or receives multicast or broadcast traffic directly, consult Apple’s entitlement rules for that operation separately.


Suppose your app should find a demo server advertising _demo._tcp. A waiting connection with localNetworkDenied sends you to the permission path. With permission enabled, if another device on the same network also cannot see the advertised service, verify that the host is running and actually publishing it. If discovery works on a lab network and fails on guest Wi-Fi, test whether the network isolates clients before filing an app networking bug.


Verify both permission outcomes


Run one denied case and one allowed case on hardware. In the denied case the app should explain why nearby-device discovery is unavailable and give the user a usable next step. In the allowed case verify both the device appearing and a request reaching the intended service. Capture one log or test observation for each outcome. A disappearance while the service is stopped should produce a different diagnosis from a denied permission. This guide is based on Apple documentation, with an illustrative example.


Official reference