简体   繁体   English

Kontakt.io iOS - 按名称识别信标

[英]Kontakt.io iOS - Identify beacon by name

In my iOS app I have some Points of Interest defined. 在我的iOS应用程序中,我定义了一些兴趣点。 Some of them have a name of a Kontakt.io beacon, that is binded to a specific PoI (I mean the name that is usually put in the sticker on the beacon). 其中一些有一个Kontakt.io信标的名称,它绑定到一个特定的PoI(我的意思是通常放在信标贴纸上的名称)。 Now I want to discover beacons nearby, then filter out those, that are further than 5 meters, take first from the filtered list and find a PoI using the taken beacon's name. 现在我想发现附近的信标,然后过滤掉超过5米的信标,先从过滤后的列表中取出,然后使用获取的信标名称找到PoI。

I was able to acomplish this task on Android version of an app ( IBeaconDevice interface used by Kontakt.io has both distance and name inside), however I cannot do this on iOS. 我能够在Android版本的应用程序上完成此任务( IBeaconDevice使用的IBeaconDevice接口同时包含距离和名称),但我无法在iOS上执行此操作。 I see, that CLBeacon class used by KTKBeaconManager has a field with distance to beacon and KTKNearbyDevice used by KTKDevicesManager has the field for the name, but I have no idea how to link them to each other or how to link my beacon with my PoI using the beacon's name. 我看,这CLBeacon通过使用类KTKBeaconManager有信标和距离场KTKNearbyDevice通过使用KTKDevicesManager有名称的领域,但我不知道如何将其链接到对方或如何使用我的POI我的信链接灯塔的名字。 Is it possible in general or should I switch to identify specific beacons by Minor parameter? 一般情况下是否可能,或者我应该切换到通过Minor参数识别特定信标?

Unfortunately, iOS does not let you correlate a Bluetooth device's advertised name with its iBeacon identifiers, as the underlying CoreBluetooth API (used to get name) and CoreLocation API (used to get beacon UUID, major minor) have no shared identifiers. 不幸的是,iOS不允许您将蓝牙设备的广告名称与其iBeacon标识符相关联,因为底层CoreBluetooth API(用于获取名称)和CoreLocation API(用于获取信标UUID,主要次要)没有共享标识符。 This is by Apple design in iOS, and restricts the Kontakt.io SDK from doing what you want, as it is dependent on CoreLocation and CoreBluetooth. 这是Apple在iOS中的设计,并限制Kontakt.io SDK执行您想要的操作,因为它依赖于CoreLocation和CoreBluetooth。

Your only option is you use beacon identifiers from CoreLocation (uuid, major, minor) to select the beacon. 您唯一的选择是使用CoreLocation(uuid,major,minor)中的信标标识符来选择信标。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM