简体   繁体   中英

Check if iDevice with a specific app is nearby

Is it possible to check within an app, if there are other idevices nearby which have the app running?

For example device A starts the app. Device B also starts the app. When they are nearby, a notification will popup.

I know its possible to check the range between two GPS coordinates. But the only solution that I've found on the internet was, that I have to make a webservice/server which handles the coordinates which were sent by the idevices.

But I'd like to make it run "offline", without saving/sending the data at a webserver.

You can achieve exactly this using the new iBeacons functionality in iOS 7. I'm not sure I can link to the exact documentation due to the NDA currently (although the feature was mentioned publicly at WWDC), but if you search for 'beacons' on the Apple Developer site you should find what you need.

There are also some examples towards the end of this year's WWDC session 307 - "What's new in Core Location?". This is arguably more useful than the documentation.

Essentially, you define a beacon region and tell your devices to start advertising their presence. At the same time, you can listen out for beacons in the local area - CoreLocation will then report you the identifier and approximate distance of each device.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM