Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
815 views
in Technique[技术] by (71.8m points)

ios - 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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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>

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...