Google Proximity Beacon API: how to register iBeacon?

此生再无相见时 提交于 2019-12-19 05:55:10

问题


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)?


回答1:


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!



来源:https://stackoverflow.com/questions/31580708/google-proximity-beacon-api-how-to-register-ibeacon

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!