Hey,
I have an app I've been experimenting with on iOS 13 that uses MultiPeerConnectivity. After upgrading to iOS 14 on one of my devices and using Xcode 12 this app no longer works. As outlined in "Support local network privacy in your app" I've added a description with NSLocalNetworkUsageDescription in Info.plist. Since the app uses Bonjour advertisting and browsing via MCNearbyServiceAdvertiser and MCNearbyServiceBrowser I've also added the service name via NSBonjourServices to Info.plist. It's my understanding that this should be enough to make browsing and advertising work.
What I am observing is that when I call startAdvertisingPeer on my instance of MCNearbyServiceAdvertiser I am not seeing the local network permission prompt instead I see the following error in the console.
Further my app is not showing up under Settings > Privacy > Local Network on my iPadOS 14 device.
I looked at the TicTacToe example which declares the bonjour service _tictactoe._tcp as its Bonjour Service but this seems to violate the Bonjour specification for service type as described in the documentation for MCNearbyServiceAdvertiser.
My code is roughly
Environment:
I have an app I've been experimenting with on iOS 13 that uses MultiPeerConnectivity. After upgrading to iOS 14 on one of my devices and using Xcode 12 this app no longer works. As outlined in "Support local network privacy in your app" I've added a description with NSLocalNetworkUsageDescription in Info.plist. Since the app uses Bonjour advertisting and browsing via MCNearbyServiceAdvertiser and MCNearbyServiceBrowser I've also added the service name via NSBonjourServices to Info.plist. It's my understanding that this should be enough to make browsing and advertising work.
What I am observing is that when I call startAdvertisingPeer on my instance of MCNearbyServiceAdvertiser I am not seeing the local network permission prompt instead I see the following error in the console.
Code Block 2020-06-27 13:26:54.634264+0100 MultiPeerTest[18970:1571288] [MCNearbyServiceAdvertiser] Server did not publish: errorDict [{ NSNetServicesErrorCode = "-72000"; NSNetServicesErrorDomain = 10; }].
Further my app is not showing up under Settings > Privacy > Local Network on my iPadOS 14 device.
I looked at the TicTacToe example which declares the bonjour service _tictactoe._tcp as its Bonjour Service but this seems to violate the Bonjour specification for service type as described in the documentation for MCNearbyServiceAdvertiser.
My code is roughly
Code Block swift localPeer = MCPeerID.init(displayName: deviceName) advertiser = MCNearbyServiceAdvertiser( peer: localPeer, discoveryInfo: [:], serviceType: "my-service" ) browser = MCNearbyServiceBrowser( peer: localPeer, serviceType: "my-service" ) browser.startBrowsingForPeers() advertiser.startAdvertisingPeer()
Environment:
Xcode 12 Beta(12A6159)
iPad Pro(10.5", 2017) running iPadOS 14.0 Beta