user3798020
user3798020

Reputation: 75

Get unique identifier for beacon in iOS?

I have Jaalee beacons. I tried to connect to them from various phones via various ways including both ibeacon and core bluetooth but all the time I get new identifiers. It means if I don't move and try iphone1 then I get set1 of beacon uuids, then I try iphone2 and get set2, then I try iphone1 and get set1 again. And there are no element which belongs to set1 and set2 simultaneously.

I tried other variables and properties but it seems all of them are common for beacons or different on various iOS devices. How to solve this issue?

Upvotes: 0

Views: 1710

Answers (2)

user3798020
user3798020

Reputation: 75

Solved. For my case (Jaalee beacons) I should perform a lot of actions in the following order:

  1. scan for beacons
  2. store beacon I found into a dictionary and request its service list
  3. if I get service list then I request characteristic list
  4. if I get characteristic list then I request value for characteristics I need
  5. If all the previous steps are successful then I get beacon proximityUUID, major and minor which are all in common represent "unique identifier"

All these steps are called asynchronously. Additionally I should delete from dictionary of beacons I found on disconnecting from them. I should also check on some steps if a beacon is still connected.

UUID which is "too unique" I use for a key in a dictionary because the beacon objects are called asynchronously.

Upvotes: 1

davidgyoung
davidgyoung

Reputation: 64916

I suspect the reason you are seeing a different UUID each time is because you are using CoreBluetooth, and CoreBluetooth does not give you the beacon's ProximityUUID -- it gives you the Bluetooth session UUID which is randomly generated in iOS. See here for details.

If you want a tool to figure out the ProximityUUIDs and you have a Mac, you might try ScanBeacon ($10) or the free Beacon CLI.

Full disclosure: I am Chief Engineer at Radius Networks which makes the above products.

Upvotes: 0

Related Questions