UBConfigurableUriBeacon Class Reference
Inherits from | NSObject |
Declared in | UBConfigurableUriBeacon.h |
Overview
This class represents a configurable UriBeacon.
Here’s an example of how to configure a beacon:
// Write beacon data.
- (void)writeURI:(NSURL *)URI
forBeacon:(UBConfigurableUriBeacon *)configurableBeacon {
UBUriBeacon *beacon = [[UBUriBeacon alloc] initWithURI:URI
txPowerLevel:32];
[configurableBeacon writeBeacon:beacon
completionBlock:^(NSError *error) {
if (error != nil) {
NSLog(@"An error happened: %@", error);
} else {
NSLog(@"The beacon has been successfully
configured.");
}
}];
}
Instance Methods
connect:
To hold a beacon in configuration mode, you need to connect to it.
- (void)connect:(void ( ^ ) ( NSError *error ))block
Parameters
- block
The block will be called when the connection is established.
Declared In
UBConfigurableUriBeacon.h
disconnect:
Disconnects when configuration is done to reflect the changes.
- (void)disconnect:(void ( ^ ) ( NSError *error ))block
Parameters
- block
The block will be called when the connection is terminated.
Declared In
UBConfigurableUriBeacon.h
readBeaconWithCompletionBlock:
Reads beacon advertisement data. The beacon must be connected before reading it.
- (void)readBeaconWithCompletionBlock:(void ( ^ ) ( NSError *error , UBUriBeacon *beacon ))block
Parameters
- block
The block will be called when the data have been read.
Declared In
UBConfigurableUriBeacon.h
writeBeacon:completionBlock:
Writes beacon advertisement data. The beacon must be connected before writing to it.
- (void)writeBeacon:(UBUriBeacon *)beacon completionBlock:(void ( ^ ) ( NSError *error ))block
Parameters
- beacon
The beacon information to write.
- block
The block will be called when the data have been written.
Declared In
UBConfigurableUriBeacon.h