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?
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")