Unable to connect two devices over P2P via DNSSD Services on iOS 14.5 Beta

Our app uses the DNSSD APIs to connect 2 iPads over Bluetooth. We use this sample code from Apple, with a single, minor adjustment: https://developer.apple.com/library/archive/samplecode/DNSSDObjects/Introduction/Intro.html#//apple_ref/doc/uid/DTS40011371-Intro-DontLinkElementID_2.

In DNSSDBrowser.m, we pass kDNSServiceInterfaceIndexP2P to DNSServiceBrowse() instead of kDNSServiceInterfaceIndexAny. We do the same for DNSServiceRegister() in DNSSDRegistration.m and DNSServiceResolve() in DNSSDServices.m to force a connection over Bluetooth. Starting with iOS 14.5 beta, this code is no longer allowing our devices to connect.

We determined if the "browsing" device is iOS 14.5 beta and the "advertising" device is not, the connection succeeds. The issue only occurs when the "advertising" device is 14.5 beta. See below for relevant code snippets.

The browsing device:
Code Block
errorCode = DNSServiceBrowse(&self->sdRef_, 0, kDNSServiceInterfaceIndexP2P, [self.type UTF8String], [domain UTF8String], BrowseReplyCallback, self);
if (errorCode == kDNSServiceErr_NoError) {
errorCode = DNSServiceSetDispatchQueue(self.sdRef, dispatch_get_main_queue());
}

The advertising device:
Code Block
errorCode = DNSServiceRegister(&self->sdRef_, 0, kDNSServiceInterfaceIndexP2P, [name UTF8String], [self.type UTF8String], [domain UTF8String], NULL, htons(self.port), 0, NULL, RegisterReplyCallback, self);
if (errorCode == kDNSServiceErr_NoError) {
errorCode = DNSServiceSetDispatchQueue(self.sdRef, dispatch_get_main_queue());
}

Both are able to browse/register without error, but no callbacks are called when the registration is on an iOS 14.5 beta device. On 14.4, everything works fine - the service is found and the devices connect successfully.

Has anyone else seen this issue or have ideas for how to resolve?

Replies

Has anyone else seen this issue or have ideas for how to resolve?

Didn’t you already talk to Matt about this?

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"
I had not yet talked to Matt at the time I posted this.
Oh, wow, I totally missed this when it was originally posted. Perhaps a long moderation delay?

Anyway, I’m glad that you got an answer.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"
We didn't, actually. This is still a problem. We re-implemented using NSNetService, which doesn't support P2P over Bluetooth like the DNSSDObjects did, as we can't afford to be completely broken when iOS 14.5 is released.