KCSIBeacon 1.2.0

KCSIBeacon 1.2.0

测试已测试
Lang语言 Obj-CObjective C
许可证 Apache 2
发布最新发布2014年12月

Michael Katz 维护。




通用的 iBeacon 管理和工具库

安装

使用

设置

  1. 使用 CocoaPods 添加到项目中
  2. 导入

     #import "KCSIBeacon.h"
    
  3. 设置您的类以符合 KCSBeaconManagerDelegate

  4. 创建一个 KCSBeaconManager 的实例

    self.beaconManager = [[KCSBeaconManager alloc] init];
    self.beaconManager.delegate = self;
    
  5. 开始监控 iBeacon 区域,例如:

    [self.beaconManager startMonitoringForRegion:@"41AF5763-174C-4C2C-9E4A-C99EAB4AE668" identifier:@"ipad" major:@(10) minor:@(1)];
    [self.beaconManager startMonitoringForRegion:@"F7826DA6-4FA2-4E98-8024-BC5B71E0893E" identifier:@"kontakt"]; //monitors all major & minor
    
  6. 实现协议方法以接收感兴趣的事件

    • 距离事件、区域进入/退出,以及是否有新近的 iBeacon。
    • 例如

      • (void)newNearestBeacon2:(CLBeacon )beacon { //如果 ([beacon.proximityUUID isEqual:kUUID] && [beacon.major intValue] == 1) { NearbyBeaconViewController nearby = [[NearbyBeaconViewController alloc] initWithNibName:@"NearbyBeaconViewController" bundle:nil]; [self presentViewController:nearby animated:YES completion:nil]; } }

文档

示例项目

系统要求

  • iOS 7 或更高版本(使用 iBeacons)

许可证

版权所有 (c) 2014 Kinvey, Inc。

根据 Apache 许可协议版本 2.0(“许可证”)授权;除非适用法律要求或经书面许可,否则不得使用此文件,但需遵守许可证。您可以在此获取许可证副本:

https://apache.ac.cn/licenses/LICENSE-2.0

除非适用法律要求或经书面同意,否则在许可证下分发的软件按“现状”基础分发,不提供任何明示或暗示的保证或条件。有关许可证的具体语言、许可和限制,请参阅许可证。