Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
829 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 Reply

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>

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...