1
votes

I'm learning iBeacon programming right now. Is it possible for an iPhone to search for any iBeacons in the area and get their UUIDs?

Say for example I have a bunch of beacons around a room and I want to see when the user gets near to a beacon. How can I see if the user is near those beacons without knowing their UUIDs previous to the proximity event?

3
Short answer - for iOS, you can't. You can only scan for predetermined UUIDS.PassKit

3 Answers

1
votes

Is it possible for an iPhone to search for any iBeacons in the area and get their UUIDs?

Short answer: no. Truthful answer: yes, but you have to use CoreBluetooth instead of CoreLocation. And it can be difficult.

iBeacons use a Bluetooth 4.0 advertisement packet to send out the 'beacon'. The structure of the packet can be found here and here. You need to use CoreBluetooth to get the advertisement data. The data you will need will be stored in the advertisementData dictionary under the CBAdvertisementDataManufacturerDataKey key. You will need to dissect this data to first, determine if the received advertisement was from an iBeacon; second, determine the UUID; third, determine the Major and Minor; and fourth, get the calibrated TX power (only if you need to estimate the distance between the iOS device and beacon). EDIT: This can only be done from OSX, not iOS

Radius Networks has done this already. Their Locate Beacon app can pick up any iBeacon.

A lot of people will tell you it can't be done, but it can.

0
votes

The 'Locate' Radius Networks app appears to only reveal beacons that have preconfigured UUIDs. If you go in and add a different UUID in the AirLocate sample from Apple, it will not be picked up by 'Locate'.

What's more, (null) is the only thing returned when I attempt to use the CBAdvertisementDataManufacturerDataKey in the advertisementData dictionary, so I'm not sure that's a solution.

One thing for certain is that it definitely isn't trivial. A work colleague of mine found a great post from MakeZine that reverse engineers the Estimote beacon. The crux of it, is a little beyond my comprehension for now, but it may provide some insight to others.

0
votes

You need to define regions you're monitoring for with your app. And a region has to be identified at least by the UUID, so basically: you cannot just scan for all the beacons around to fetch their UUIDs.

Technically, you can also give the user access to provide UUID to scan for in the app, but Apple is rather against that, so there's a big chance such app will be rejected from the App Store.

Cheers.