5

I've been doing quite a bit of research on iBeacons and CoreBluetooth on iOS devices. Your posts and research have been great. I've learned quite a bit. Unfortunately, i'm running into a dead end as it pertains to what I actually want to do.

I was reading this post: http://developer.radiusnetworks.com/2013/10/21/corebluetooth-doesnt-let-you-see-ibeacons.html....

...and it points out that you can't really do much with CoreBluetooth without the proximityUUID. That said, what if I actually DO have it?

What i want to do is place iBeacons around a given location. I'll use the didEnterRegion CLLocationManager delegate method to know when we've entered the region. I want to use that to trigger some CoreBluetooth monitoring of the beacons so it can be done in the background. I only need the RSSI and a unique identifier (I can do without the Major and Minor for now), which i've been able to get in the foreground, but not in the background.

I was under the impression that I should still be able to get this basic data in the background if my app had 'bluetooth-central' (now "App Communicates using CoreBluetooth") set.

Can you shed any light on what I'm trying to do? At present, it doesn't seem like anyone else has tried this and I'd love to get it going and share it, as it seems like a viable work-around if I can get past this barrier.

Thoughts?

d2burke
  • 4,081
  • 3
  • 39
  • 51

2 Answers2

4

As mentioned in the blog post, you cannot get any of the iBeacon identifiers out of the CoreBluetooth APIs because iOS does not provide access to the raw advertising data that encapsulates these identifiers.

You may be able to do correlations. If only one BluetoothLE device is visible, and you just saw an iBeacon using CoreLocation APIs, you can continue to track the beacon with CoreBluetooth, reading the RSSI as you suggest.

The trouble comes when multiple BluetoothLE devices are visible. Without access to the iBeacon identifiers in CoreBluetooth, how will you know which device you are seeing in CoreBluetooth lines up with which of the iBeacons you see with CoreLocation? Unfortunately, I do not think there is any way to match them up.

davidgyoung
  • 63,876
  • 14
  • 121
  • 204
  • Hmm, let's say I hook them up to a test app and get their device UUID ahead of time and program the app around that. Would that work? My issue currently is that I can't even get the demo app i'm building to recognize the BLE devices i'm testing with in the background at all (Estimote Beacons). When in the foreground, I can see the device UUID and RSSI on a regular interval. As soon as it enters the background, everything stops because there's no service to subscribe to, thus no events :( – d2burke Dec 05 '13 at 15:31
  • 2
    @d2burke The UUID iOS gives you for a generic BLE device is one locally invented by iOS as a way for your app to refer to the BLE device, it has nothing to do with the region UUID broadcast in the iBeacon advertising packet. Testing confirms that two iOS devices hearing the same BLE device will assign it *different* local device UUIDs, so pre-mapping is not likely to get you anything. – Chris Stratton Dec 05 '13 at 16:20
  • @ChrisStratton Hmm, this is sad news, but a great point that I did not consider. Thanks Chris. – d2burke Dec 05 '13 at 16:22
  • Chris is correct: that UUID actually changes for the same device each time it comes into view. It is just a temporary reference identifier generated by iOS and used for the duration the device is being tracked. – davidgyoung Dec 05 '13 at 19:07
  • In the end, this answer was correct. Using the iBeacon APIs and BL devices with the proximity profile alone, this is just not possible. It seems that Apple really didn't design this for solid micro-location. – d2burke Jan 29 '14 at 15:27
4

As suggested, is not possible but almost every big manufacturer like Kontakt.io or Estimote uses a special UUID Service for identifier, battery and other things.

You can write your own framework that recognize this kind of iBeacon using CoreBluetooth, keep in your mind that Service UUID data is not the major, minor, uuid etc.. but just an identifier of a device, you should definitely create a database or plist with matching between id of Service data and UUID, major and minor of iBeacon.

In this way you are able to take every packet from iBeacon and do your stuff with it.

pascalbros
  • 16,122
  • 5
  • 23
  • 35