NSNetServiceBrowser broken on iOS 14

I’ve noticed that the NSNetServiceBrowser doesn’t seem to work on the latest builds of DA (.1495) when running on iOS devices with 14.2 on them.

To see this, you can simply run https://github.com/remobjects/ZeroConfBrowser on a device. It works perfectly on a device with iOS up to (as far as I have) 13.4.1 (also happy on 12.4.9) but it doesn’t see any services on a device with iOS 14.2.

I have an app in the app store released in Dec 2019 (can’t recall the version but most likely whatever was the stable one then) and it works on 14.2 so I conclude that something has changed that has caused this.

I’ve also tried it on a simulator and it is the same.

Actually, looking closer at this sample, it isn’t actually a RO SDK issue, since it doesn’t have it added, so I’ll move it to Elements in case that’s where the issue is. I thought it was as I’m trying to use it to connect to a TROZeroConfRegistration Delphi component. I only realised this when I reverted to an old DA/RO and it was the same.

Is this NSNetServiceBrowser itself thats not working, or code isn RO/DA that uses it?

Well, if you just build and run this, it works on older iOS but not on the latest. It just doesn’t get a response to the request for services. It does on older iOS, and and if you’d built this a year ago it would work on 14.2. I put it in the RO SDK category to start with, until I noticed that this project doesn’t even reference it so assume it must be an elements issue.

I should add that I noticed this in my own app, and was going to build a test case and thought I’d start with this since it works the same way my app does (it is just looking on the WiFi for my Delphi DA server).

Right, but I’m saying, NSNetServiceBrowser isn’t our class, it’s Apple’s. If it doesn’t work, then Apple broke it? :slight_smile:

Thanks, understood. I found it does work if I build it with Xcode 11, so further investigation let me to https://developer.apple.com/videos/play/wwdc2020/10110/ and it is this new network privacy permission that seems to stop it working, so that should help in my own app.

In the RO sample above, I just added these to the info.plist to get it also working with Xcode 12.2:

<key>NSBonjourServices</key>
<array>
    <string>_services._dns-sd._udp.</string>
</array>
<key>NSLocalNetworkUsageDescription</key>
<string>Looking for some stuff</string>

interesting!

I’ll fix the sample. thanx!