Search code examples
iosbluetooth-lowenergyibeacon

Find all device inside the range in iBEACON and share contact with each other


I want to develop the application which will list me all the device which are in range.

And any of the devices in range should share the contact in the list.

I found one demo which will locate the nearby users. But how do I get notified and get the contact list of each other?


Solution

  • OK - I think you are asking quite a lot of questions in the above. I think what you mean by 'device in range' is iOS devices in range using Bluetooth Low Energy. Then what you're asking is:

    1. How do I make an iPhone app that makes my iPhone behave like an iBeacon?

    2. How do I detect iBeacons in my app? (and are you interested just in foreground detection or foreground plus background? You use a combination of region monitoring and beacon ranging depending on what you need.)

    3. How do I get access to the contacts on the iPhone?

    4. How can I share contacts between devices?

    For 1 and 2 there are quite a few tutorials to show you how to do this. Try:

    http://www.appcoda.com/ios7-programming-ibeacons-tutorial/

    http://www.devfright.com/ibeacons-tutorial-ios-7-clbeaconregion-clbeacon/

    For 3, take a look at Programmatically Request Access to Contacts

    For 4, it depends what model you have in mind. You could

    • send the data to your server then the server could send out to the relevant device (maybe with a push notification)
    • send the data directly by making a Bluetooth connection to the other phone.

    hth