Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Proximity Beacon API: how to register iBeacon?

The Google's Proximity Beacon API documentation uses Eddystone as an example everywhere:

https://developers.google.com/beacons/proximity/register

However, documentation mentions two more types of beacons, AltBeacon and iBeacon.

If I understand correctly, something like this should be used (adapted from Google's example):

 {
  "advertisedId": {
   "type":"IBEACON",
   "id":"base 64 of what???"},
  "status":"ACTIVE",
  "latLng": {
     "latitude": 51.4935657,
     "longitude": -0.1465538
   }
}

However, what is the acceptable binary format for iBeacon's UUID,Major,Minor (which should be base64'd)?

like image 710
Roman Susi Avatar asked Jul 23 '15 07:07

Roman Susi


1 Answers

The id of the advertisedId will be the 20 bytes of the iBeacon UUID + major + minor base64 encoded directly from the binary form. (i.e. don't print it out as hex or text first before base64 encoding. Just take the blob and base64 that).

Otherwise your request looks right!

like image 176
MarcWan Avatar answered Oct 14 '22 16:10

MarcWan