0

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?

Yakk - Adam Nevraumont
  • 262,606
  • 27
  • 330
  • 524
ios developer
  • 3,363
  • 3
  • 51
  • 111

2 Answers2

1

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

Community
  • 1
  • 1
CharlesA
  • 4,260
  • 2
  • 25
  • 31
  • how to create the bluetooth connection to phone? By ibeacon – ios developer Jul 24 '14 at 08:51
  • iBeacon doesn't allow you to send data. It's pretty limited - you just get a UUID (string), and a major and minor integer. The iBeacon allows you to detect that a device is close by. To make a bluetooth connection to send data there are a few different ways to do this. Take a look at http://stackoverflow.com/questions/14575706/send-string-by-bluetooth-iphone-sdk to just GameKit to handle this for you (as one approach) – CharlesA Jul 24 '14 at 09:04
0

Typically, a practical implementation of something like this would have phones reporting their discovery of a beacon to a server, which would from their ability to hear a given beacon then know their high-accuracy location. The server could then (subject to some set of rules) tell them about other devices in the area, and proxy data between them.

You'll need the server anyway, as the options for direct mobile-to-mobile data transfer are quite limited.

Also, an iOS device cannot advertise as a beacon in the background, but it can (to an extent) discover beacons while in the background, so having the phones be listeners rather than transmitters will make your app more usable.

Chris Stratton
  • 39,853
  • 6
  • 84
  • 117