ioswwdc

Issue with Nearby Interaction with real device


After WWDC20, I see an amazing framework : Nearby Interaction.

But when I try to download the project from : https://developer.apple.com/documentation/nearbyinteraction

It works on simulator but not on a real device, it can exchange the token but I can see that the delegate :

func session(_ session: NISession, didUpdate nearbyObjects: [NINearbyObject])

never call at all. Both my iPhone are 11.

Anyone has a solution?


Solution

  • Ultra Wideband availability

    Devices equipped with the Apple-designed U1 chip have Ultra Wideband technology for spatial awareness. Learn which iPhone models and which countries and regions support Ultra Wideband.

    Ultra Wideband is available on iPhone 11, iPhone 12, and iPhone 13 models. Ultra Wideband isn't available in all countries or regions and is subject to international regulatory requirements that require it to be turned off in certain locations.

    Ultra Wideband isn't available in these countries or regions:

    See: https://support.apple.com/en-al/HT212274

    If you are not located in these countries, you need to check your info.plist to make sure Bonjour Services listed there. Also, make sure that service name must be same with the declared one in plist. For example:

    <key>NSBonjourServices</key>
    <array>
        <string>_nisample._tcp</string> // ATTENTION: _nisample._tcp
    </array>
    
    mcBrowser = MCNearbyServiceBrowser(peer: localPeerID, serviceType: "nisample")