swift – iOS native community permission immediate not showing for `MultipeerConnectivity` regardless of `NSBonjourServices` in `Data.plist`


I am constructing an iOS app utilizing MultipeerConnectivity for native peer-to-peer networking. The native community permission immediate is not showing, and I am getting -72008 errors (NSNetServicesErrorDomain).

Drawback:

  • When utilizing MultipeerConnectivity (MCNearbyServiceAdvertiser or MCNearbyServiceBrowser), iOS ought to present a permission immediate: “App want to discover and connect with units in your native community.”
  • The immediate by no means seems
  • Community operations fail with error: NSNetServicesErrorDomain error -72008
  • The app would not seem in Settings > Privateness & Safety > Native Community

What I’ve verified:

  1. NSLocalNetworkUsageDescription is current in Data.plist
  2. NSBonjourServices array is current with the proper service sort: _kaunwho._tcp
  3. The service sort matches what MultipeerConnectivity makes use of (with out the _tcp suffix in code: "kaunwho")
  4. Data.plist accommodates each keys after construct:
    NSLocalNetworkUsageDescription
    KaunWho makes use of native networking to attach close by units for multiplayer gameplay.
    NSBonjourServices
    
        _kaunwho._tcp
    
    

Code:

// Service sort utilized in code
personal let serviceType = "kaunwho"  // 1-15 chars, lowercase, alphanumeric + hyphens

// Beginning advertiser
advertiser = MCNearbyServiceAdvertiser(peer: myPeerID, discoveryInfo: nil, serviceType: serviceType)
advertiser?.delegate = self
advertiser?.startAdvertisingPeer()

What I’ve tried:

  1. Verified Data.plist accommodates NSBonjourServices (confirmed through plutil -p)
  2. Deleted and reinstalled the app fully
  3. Cleaned construct folder and rebuilt
  4. Examined on my iPhone 13 and likewise on an iPhone 17 Professional (not simply simulator)
  5. Ensured the app makes use of MultipeerConnectivity when testing (tapping buttons that set off startAdvertisingPeer())

Setting:

  • iOS 18.0+
  • Xcode 26.0
  • SwiftUI app
  • MultipeerConnectivity framework

Questions:

  1. Is there one thing else required to set off the permission immediate?
  2. Ought to the permission immediate seem routinely on first use, or do I have to request it explicitly?
  3. Might a earlier denial (even when not seen) stop the immediate from showing?
  4. Are there any identified points with MultipeerConnectivity and iOS 18 that may have an effect on this?

Further context:
Based on Apple’s documentation, each NSLocalNetworkUsageDescription and NSBonjourServices are required. I’ve verified each are current, however the immediate nonetheless would not seem.

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles