【问题标题】:How to connect to a beacon ESTIMOTE如何连接到信标 ESTIMOTE
【发布时间】:2014-05-06 16:14:09
【问题描述】:

我正在查看适用于 iPhone 的 SDK 来估算信标,我明白了

- (void)connectToBeacon

连接到信标,但我如何通过它是 UUID,主要和次要连接,似乎不允许我。

任何建议都会很棒..

谢谢

【问题讨论】:

    标签: ios objective-c estimote


    【解决方案1】:

    连接到信标时,您不使用主要/次要。此方法用于连接到信标以更改 UUID、主要和次要广播值等内容。这将像这样使用:

    ESTBeacon *myBeacon = ...;
    [myBeacon connectToBeacon];
    

    编辑:您需要连接到范围内的信标,您通常可以从ESTBeaconManagerbeaconManager:didDiscoverBeacons:inRegion: 获取该信标,这将为您提供NSArray 范围内的ESTBeacon 对象。

    【讨论】:

    • 不用担心 stonz2 我知道了 :)
    【解决方案2】:

    希望对你有所帮助。

    // you declare your beacon and your manager
    @property (nonatomic, strong) ESTBeacon* myBeacon;
    @property (nonatomic, strong) ESTBeaconManager* beaconManager;
    
    // You create the objects 
    self.beaconManager = [[ESTBeaconManager alloc] init];
    myRegion = [[ESTBeaconRegion alloc] initWithProximityUUID:ESTIMOTE_PROXIMITY_UUID
                                                          major:11111 minor:22222 identifier:@"beacon1"];
    // this will returns an array of beacons
    - (void)startRangingBeaconsInRegion:(ESTBeaconRegion *)myRegion
    
    // this will allow  you to manage the array.
    -(void)beaconManager:(ESTBeaconManager *)manager
         didRangeBeacons:(NSArray *)beacons
                inRegion:(ESTBeaconRegion *)myRegion
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-03-23
      • 1970-01-01
      相关资源
      最近更新 更多