-2

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

- (void)connectToBeacon

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

任何建议都会很棒..

谢谢

4

2 回答 2

1

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

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

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

于 2014-05-06T16:22:51.347 回答
0

我希望这能帮到您。

// 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
于 2014-05-18T14:45:49.680 回答