【发布时间】:2014-07-15 05:18:48
【问题描述】:
我为信标创建了一个 iphone 应用程序。我想在退出所有信标区域时显示消息。
我不想显示每个信标退出区域的消息。例如,如果有 3 个信标,我只想在退出所有 3 个信标时显示消息。有可能吗?
我还想在
didExitRegion中获取现有的信标主要和次要值
我使用了以下代码:
-(void)locationManager:(CLLocationManager*)manager
didRangeBeacons:(NSArray*)beacons
inRegion:(CLBeaconRegion*)region
{
// Beacon found!
NSLog(@"iBeacons found");
// UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Successfully found" message:nil delegate:nil cancelButtonTitle:@"Ok" otherButtonTitles: nil]; [alert show];
CLBeacon *foundBeacon = [beacons firstObject];
// You can retrieve the beacon data from its properties
NSString *uuid = foundBeacon.proximityUUID.UUIDString;
NSString *majorId = [NSString stringWithFormat:@"%@", foundBeacon.major];
NSString *minorId = [NSString stringWithFormat:@"%@", foundBeacon.minor];
NSLog(@"UUID: %@", uuid);
}
在上面的代码中,我可以获得信标的 uuid、major、minor。但我想在didExitRegion 中获取现有信标的值。有可能吗?
提前致谢。
【问题讨论】:
标签: ios iphone objective-c ibeacon