admin管理员组文章数量:1418683
My iBeacon, in addition to the standard UUID, Major, Minor, RSSI data, contains additional information about the battery level, which is located in a set of raw data bytes.
On Android, I can easily get this value using the altbeacon
library, which ultimately receives an object that includes an array of LastPocketRawDataBytes
bytes.
When detecting a beacon in an iOS application using CoreLocation
, I get a CLBeacon
object, which does not include an array of raw data. In addition, when detecting the same beacon using CoreBluetooth
, its advertising data does not include any Manufacturer Data array.
How can I get an array of raw data bytes from iBeacon?
P.S. I found a similar question regarding a similar problem, but in this case you will have to interfere with the beacon (if this is the only solution, then I am ready to consider various options for this)
My iBeacon, in addition to the standard UUID, Major, Minor, RSSI data, contains additional information about the battery level, which is located in a set of raw data bytes.
On Android, I can easily get this value using the altbeacon
library, which ultimately receives an object that includes an array of LastPocketRawDataBytes
bytes.
When detecting a beacon in an iOS application using CoreLocation
, I get a CLBeacon
object, which does not include an array of raw data. In addition, when detecting the same beacon using CoreBluetooth
, its advertising data does not include any Manufacturer Data array.
How can I get an array of raw data bytes from iBeacon?
P.S. I found a similar question regarding a similar problem, but in this case you will have to interfere with the beacon (if this is the only solution, then I am ready to consider various options for this)
Share Improve this question edited Feb 7 at 7:40 Sunbey13 asked Jan 31 at 8:40 Sunbey13Sunbey13 4335 silver badges15 bronze badges2 Answers
Reset to default 2Unfortunately, iOS blocks reading the raw bytes of a Bluetooth advertisement in the iBeacon format.
The CoreLocation API allows you to detect iBeacon advertisements, but fields are limited. You can only read the iBeacon Proximity UUID, Major, and Minor identifier. This API allows no access to any other fields.
The CoreBluetooth API does not allow you to detect iBeacon advertisements at all. Apple has implemented filter in software that blocks reading iBeacon with this API. So while the API does allow access to all fields inside Bluetooth advertisements in general, iBeacon advertisements are an exception to this ability. See my blog post here about this iOS restriction.
One possible alternative may be to use a different beacon format. Some beacon manufacturers allow you to configure a beacon to advertise different formats and sometimes two formats at once. If you can configure the beacon to advertise AltBeacon (instead of or in addition to iBeacon), then you can use the iOS CoreBluetooth APIs to read these additional fields. One caveat on this technique: Your iOS app must be in the foreground to read these fields.
You cannot get anything other than the iBeacon information (uuid, major, minor) from Core Location. The iBeacon specification doesn't include any data other than these three things.
For other data you will need to use Core Bluetooth, which does provide access to the advertising data,
You see likely to have issues when your app is in the background with that method.
本文标签: core locationGet raw byte data array from ibeacon in ios appStack Overflow
版权声明:本文标题:core location - Get raw byte data array from ibeacon in ios app - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745274264a2651084.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论