ios - 监听多个 UUID 的应用程序

标签 ios uuid monitor ibeacon

一个 ios 应用程序可以监听多个 UUID 吗?专为苹果 iBeacon 技术。

NSUUID *uuid = [[NSUUID alloc] initWithUUIDString:@"23542266-18D1-4FE4-B4A1-23F8195B9D39"];
    self.beaconRegion = [[CLBeaconRegion alloc] initWithProximityUUID:uuid identifier:@"com.devfright.myRegion"];
    [self.locationManager startMonitoringForRegion:self.beaconRegion];

使用此代码可以开始监视以下 uuid:23542266-18D1-4FE4-B4A1-23F8195B9D39,如果我添加另一个监听另一个 uuid 的类,这会起作用吗,不会有任何干扰吗?也许再添加几个听众?

最佳答案

每个应用最多可以监听 20 个 UUID。只需创建更多 CLBeaconRegion,然后为每个要监控的区域调用 startMonitoringForRegion:。您只需要一个 CLLocationManager 即可执行此操作。

请注意,对于您监控的每个 区域,您将收到对 didEnterRegion:/didExitRegion: 的调用。 region 参数将告诉您您进入了哪个区域。

UUID限制源数:https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/LocationAwarenessPG/RegionMonitoring/RegionMonitoring.html#//apple_ref/doc/uid/TP40009497-CH9-SW2

关于ios - 监听多个 UUID 的应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21276440/

相关文章:

c# - 为什么每个人都说 SpinLock 更快?

c# - 启动应用程序并将其发送到第二台显示器?

android - 我如何确定我的 android 应用程序中的互联网速度

ios - 以编程方式调用 push segue 和 prepareforsegue 方法

iphone - 绘制矩形没有响应

python - 我如何证明某些数据来 self 的应用程序?

c# - 如何在.NET中获取磁盘的分区UUID

sql - GUID 有没有可能全部用完?

ios - 在 Swift 中的 tableviewcell 之间添加空间

ios - 追踪低内存警告的根本原因