How to associate data with a beacon? (cordova-ble)

Ask, and ye shall receive.
mza
Posts: 3
Joined: 23:17, 20 Apr 2015

How to associate data with a beacon? (cordova-ble)

Postby mza » 23:31, 20 Apr 2015

I opened this issue earlier: https://github.com/evothings/cordova-ble/issues/64

I guess my final question on that page isn't related to the bug which is why it didn't receive a response.

If iOS devices aren't using the MAC addresses, and instead generating their own UUID per beacon, how can I associate with this randomly generated address an object in my remote DB? Or rather, with cordova-ble, what's the proper way to associate a device with the information you want to present? It doesn't seem like `device.address` is a reliable way to identify a device. My beacons are are using the TICC2541, and I'm not seeing the UUID anywhere in the device object within the evothings.ble.startScan callback.

This would be a huge help if someone could give me some guidance here. Thanks for the great library and community!

Fredrik
Site Admin
Posts: 196
Joined: 15:00, 18 Nov 2013

Re: How to associate data with a beacon? (cordova-ble)

Postby Fredrik » 09:49, 21 Apr 2015

I've commented on the issue. I'll give a slightly different answer here.

Apple has blocked iBeacon information from appearing in their CoreBluetooth API. That means the cordova-ble plugin cannot access it.

We have another plugin, cordova-plugin-ibeacon, that should be more helpful in your case.

iBeacons work like this: Each beacon has a Manufacturer UUID (128 bits), a Major ID (16 bits) and a Minor ID (16 bits). The Manufacturer UUID(s) must be hard-coded into your app. The app will then detect only beacons with those UUIDs.

Major ID is intended to identify a location, like a store or warehouse. Minor ID is intended to identify a point within that location, like a shelf or a movable object. However, you may repurpose these IDs as you see fit.

Anyway, this Major/Minor ID is how you associate an iBeacon with a database entry.

mza
Posts: 3
Joined: 23:17, 20 Apr 2015

Re: How to associate data with a beacon? (cordova-ble)

Postby mza » 20:17, 21 Apr 2015

Hi Fredrik, thanks for your response. I actually wasn't intending on using the estimotes, I ordered some beacons from a manufacturer on Alibaba, but the Service ID seems to be changed by Apple on every device. I can't really hard code that into the app. However, I noticed that the advertisement data for estimotes was consistent across devices. I've been using phonegap-estimotebeacons for ios devices and i'm using cordova-ble for android devices. i've been using cordova-ble and have an app written around this, but ios has been giving me troubles, and i finally determined what it was yesterday.

Thank you for everything Fredrik!


Return to “Questions and answers”

Who is online

Users browsing this forum: No registered users and 33 guests