Local Network, Bonjour, and Hotspot capabilities not appearing in Xcode (React Native iOS)
I am working on a React Native iOS project that needs Local Network, Bonjour Services, and Hotspot Configuration capabilities to enable device discovery over UDP, SSDP, and mDNS.
The app works correctly in Debug and local Release builds, but fails in TestFlight because these capabilities are missing from the final.ipa.
However, in Xcode:
- The Local Network capability does NOT appear under Signing & Capabilities
- The Bonjour Services capability does NOT appear
- The Hotspot Configuration capability does NOT appear
I believe this is because the project does not have a proper .entitlements file attached to the target.
What I need help with:
- How do I correctly create an entitlements file for my target?
- Where exactly should the entitlements file be placed inside the iOS project?
- What should be added under Build Settings → Code Signing Entitlements?
- Why do some capabilities not appear in Xcode until a valid entitlements file is configured?
Current entitlements issue:
My current entitlements file is invalid and looks like multiple broken plist fragments, so Xcode does not detect it:
<?xml version="1.0" encoding="UTF-8"?>
<plist><true/></plist>
... (two more broken plist fragments)
Because of this, Xcode hides the available capabilities.
The capabilities I need to activate:
com.apple.developer.networking.local-networkcom.apple.developer.networking.HotspotConfigurationcom.apple.developer.networking.wifi-infoNSBonjourServices(array of service types)
Expected behaviour:
After creating a correct entitlements file and linking it under
Build Settings → Code Signing Entitlements,
I should see:
- Local Network
- Bonjour Services
- Hotspot Configuration
- Access WiFi Information
in the Signing & Capabilities panel.