Вопрос

I am looking at the SDK for iPhone for estimate beacons, I see

- (void)connectToBeacon

to connect to the beacon, but how can i pass it is UUID,Major and Minor to connect, doesn't seem to allow me.

any advice would be great..

thanks

Это было полезно?

Решение

You don't use the major/minor when connecting to a beacon. This method is used to connect to a beacon in order to change things like the UUID, major, and minor broadcast values. This would be used like:

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

Edit: you need to connect to a Beacon in range, and you can typically get that beacon from ESTBeaconManager's beaconManager:didDiscoverBeacons:inRegion: which will give you a NSArray of ESTBeacon objects in range.

Другие советы

I hope this will help you.

// 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
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top