iOS iBeacon:如何以编程方式获取所有的proximityUUID? [英] iOS iBeacon: How to get all of proximityUUID programmatically?

查看:504
本文介绍了iOS iBeacon:如何以编程方式获取所有的proximityUUID?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望以编程方式查看广告数据包的所有proximityUUID。有些文章称iOS上不可能,但Android是可行的。但我无法相信它,因为我发现了梦幻般的应用程序BLExplr具有该功能。我需要在我的应用程序中实现该功能。有谁知道怎么做或好的例子?任何帮助将不胜感激。

I want to see all of proximityUUID of advertising packets programmatically. Some articles say that it is impossible on iOS but Android is possible. But I cannot believe it because I found the fantastic app "BLExplr" has the feature. I need to implement the function into my app. Does anyone knows how to do it or good examples? Any help will be appreciated.

(更新2014/1/17)

(UPDATE 2014/1/17)

我相信@davidgyoung回答是对。 Estimote beacon的proximityUUID是B9407F30-F5F8-466E-AFF9-25556B57FE6D,但在BLExplr app上显示我的Estimote beacon的UUID是另一个ID。

I believe @davidgyoung answer is right. Estimote beacon's proximityUUID is "B9407F30-F5F8-466E-AFF9-25556B57FE6D" but displayed my Estimote beacon's UUID on BLExplr app is another ID.


< img src =https://i.stack.imgur.com/liIVV.pngalt =在此处输入图像说明>

推荐答案

不幸的是,你不能在iOS上这样做。当你说BLExplr和LightBlue可以做到这一点时,你会将蓝牙服务UUID与iBeacon Proximity UUID混淆。这是两件截然不同的事情。

Unfortunately, you cannot to this on iOS. When you say that BLExplr and LightBlue can do this, you are confusing the Bluetooth service UUID with the iBeacon Proximity UUID. These are two very different things.

蓝牙服务UUID对iOS可见,但与iBeacon的标识符无关,对于使用iBeacons毫无用处。每次看到蓝牙设备时,iOS都会生成服务UUID,并且只在蓝牙设备处于范围内的持续时间内保持相同。如果您将蓝牙设备拿走并稍后将其恢复,它将具有不同的服务UUID。

The Bluetooth service UUID is visible to iOS, but has nothing to do with an iBeacon's identifiers, and is useless for working with iBeacons. The service UUID is generated by iOS each time a bluetooth device is seen, and stays the same only for the duration of time the bluetooth device is in range. If you take a bluetooth device away and bring it back later, it will have a different service UUID.

iBeacon的标识符(ProximityUUID,Major,Minor)嵌入在蓝牙广告的主体。 iOS设备上的问题是Apple的CoreBluetooth API不允许访问原始广告主体,因此没有第三方应用程序能够读取这些标识符。 Apple只允许使用特殊的iBeacon CoreLocation API访问这些标识符,但这些API要求您事先知道Proximity UUID。

An iBeacon's identifiers (ProximityUUID, Major, Minor) are embedded inside the body of the Bluetooth advertisement. The problem on iOS devices is that Apple's CoreBluetooth APIs disallow access to the raw advertisement body, so no third-party app is able to read these identifiers. Apple only allows access to these identifiers using the special iBeacon CoreLocation APIs, but these APIs require you to know the Proximity UUID up front.

抱歉,我知道这不是回答你想听到的! (我也很抱歉!)对于它的价值,您可以在Android,OSX Mavericks和Linux上执行此操作。

Sorry, I know this is not the answer you want to hear! (I'm sorry about it, too!) For what it's worth, you can do this on Android, on OSX Mavericks and Linux.

查看详细信息在其他地方

这篇关于iOS iBeacon:如何以编程方式获取所有的proximityUUID?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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