Post not yet marked as solved
Post marked as unsolved with 4 replies, 572 views
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:
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:
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?