Vinay Kiran
Vinay Kiran

Reputation: 347

Test Flight - Local Network permission, NSBonjourServices error in TestFlight build

For iOS14 we are supposed to get the local network permission from the user. The app works fine if I run directly on the device or export it as an Enterprise application. If I upload the same app to Test flight I am getting the following error.

App Info.plist(NSBonjourServices) does not allow '_xxx-xxx-config._tcp.' for (Lhoapp)

What is this error? How to fix this?

In Info.plist I have added the following services used in app:

<key>NSBonjourServices</key>
    <array>
        <string>_xxx-xxx-config._tcp</string>
        <string>_iri._tcp</string>
    </array>

I am getting the following errors in the log

["NSNetServicesErrorDomain": 10, "NSNetServicesErrorCode": -72008]

I have enabled the Local network permission under privacy for the app

Upvotes: 2

Views: 4712

Answers (2)

Pistol Felix
Pistol Felix

Reputation: 13

Adding both of NSLocalNetworkUsageDescription and NSBonjourServices keys in Infos.plist is the correct solution for me. This is required since iOS 14 and it makes NSNetServices finding services. Thank a lot for this information.

Upvotes: 0

zeytin
zeytin

Reputation: 5643

Apple document indicates that for NSLocalNetworkUsageDescription

Any app that uses the local network, directly or indirectly, should include this description. This includes apps that use Bonjour and services implemented with Bonjour, as well as direct unicast or multicast connections to local hosts.

Then you need to add NSLocalNetworkUsageDescription And your plist should be like this, of course change your app name and tcp.

<key>NSLocalNetworkUsageDescription</key>
<string>Exchange data with nearby devices running the Yourapp.</string>
<key>NSBonjourServices</key>
<array>
    <string>_yourApp._tcp</string>
</array>

Upvotes: 3

Related Questions