'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 1:[1]
Make sure airplane mode is not turned on - https://support.apple.com/guide/iphone/ultra-wideband-information-iph771fd0aad/ios
Solution 2:[2]
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:
- Armenia
- Azerbaijan
- Belarus
- Indonesia
- Kazakhstan
- Kyrgyzstan
- Nepal
- Russia
- Tajikistan
- Turkmenistan
- Ukraine
- Uzbekistan
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")
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Drakula_65 |
| Solution 2 |
