<p>
iOS 8 之后定位需要加字段在info.plst里面,NSLocationAlwaysUsageDescription 一直定位、NSLocationWhenInUseUsageDescription 使用时定位</p><p><span style="white-space: pre;"> </span>苹果目前允许beacon在后台一直搜寻,但是传统的定位会以损耗电池为由拒绝通过。(未验证beacon后台可以上线)</p><p><span style="white-space: pre;"> </span>定位的heading,即方向是不需要用户同意的,判断设备可用即可。</p><p><span style="white-space: pre;"> </span>接下来附demo</p>
#define myUUID @"AB8190D5-D11E-4941-ACC4-42F30510B408"
- (void)viewDidLoad {
[super viewDidLoad];
NSUUID *uuid = [[NSUUID alloc]initWithUUIDString:myUUID];
_myBeaconRegion = [[CLBeaconRegion alloc] initWithProximityUUID:uuid identifier:@"test"];
_myBeaconRegion.notifyOnEntry = YES;
_myBeaconRegion.notifyOnExit = YES;
_myBeaconRegion.notifyEntryStateOnDisplay = YES;
[self createLocationManager];
self.countryLabel.text = @"正在检测";
self.cityLabel.text = @"正在检测";
_mutArray = [NSMutableArray array];
}
#pragma mark - createLocationManager
-(void)createLocationManager{
_manager = [MyCLLocationManager sharedManager];
_manager.delegate = self;
_manager.desiredAccuracy = kCLLocationAccuracyKilometer;
//ignore filter default kCLDistanceFilterNone will report any change
_manager.distanceFilter = 500;
_bluetoothManager = [[CBPeripheralManager alloc]initWit