Google Proximity Beacon API:如何注册iBeacon? [英] Google Proximity Beacon API: how to register iBeacon?

查看:88
本文介绍了Google Proximity Beacon API:如何注册iBeacon?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Google的邻近信标API文档在每个地方都以Eddystone为例:

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

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

但是,文档中提到了另外两种信标类型,即AltBeacon和iBeacon.

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

如果我理解正确,则应使用类似以下内容(改编自Google的示例):

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
   }
}

但是,iBeacon的UUID,Major,Minor(应为base64'd)可接受的二进制格式是什么?

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

推荐答案

advertisedId的ID将是直接从二进制格式编码的iBeacon UUID + major + minor base64的20个字节. (也就是说,在进行base64编码之前,请不要先将其打印为十六进制或文本.只需将blob和base64都打印出来即可.)

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!

这篇关于Google Proximity Beacon API:如何注册iBeacon?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆