Closed OmarHallab closed 9 years ago
@OmarHallab
[self.beaconManager requestAlwaysAuthorization];
[self.beaconManager requestWhenInUseAuthorization];
Get this code and insert it bellow init of ESTBeaconManager i think it could be fix your problem.
Yup, missing the Location Services authorization code. See an article from our Knowledge Base: How to use Location Services with Estimote SDK in iOS 8+?
Hello all I am in need of some guidance with the new SDK, I have been trying to work with the notification example but it somehow is not working with the new SDK Here is my code:
import "ViewController.h"
@interface ViewController ()
@property (nonatomic, strong) CLBeacon beacon; @property (nonatomic, strong) ESTBeaconManager beaconManager; @property (nonatomic, strong) CLBeaconRegion *beaconRegion;
@end
@implementation ViewController
(void)viewDidLoad { [super viewDidLoad];
self.beaconManager = [[ESTBeaconManager alloc]init]; self.beaconManager.delegate = self;
self.beaconRegion = [[CLBeaconRegion alloc]initWithProximityUUID:ESTIMOTE_PROXIMITY_UUID major:18958 minor:17157 identifier:@"EstimoteRegion"];
self.beaconRegion.notifyOnEntry = YES; self.beaconRegion.notifyOnExit =YES;
[self.beaconManager startRangingBeaconsInRegion:self.beaconRegion]; [self.beaconManager startMonitoringForRegion:self.beaconRegion]; [self.beaconManager requestStateForRegion:self.beaconRegion];
}
(void)beaconManager:(id)manager didEnterRegion:(CLBeaconRegion *)region {
UILocalNotification *notification = [[UILocalNotification alloc]init]; notification.alertBody= @"Welcome user!"; notification.soundName = UILocalNotificationDefaultSoundName;
[[UIApplication sharedApplication] presentLocalNotificationNow:notification];
}
(void)beaconManager:(id)manager didExitRegion:(CLBeaconRegion *)region {
UILocalNotification *notification = [[UILocalNotification alloc]init]; notification.alertBody= @"Welcome user!"; notification.soundName = UILocalNotificationDefaultSoundName;
[[UIApplication sharedApplication] presentLocalNotificationNow:notification];
}
pragma mark - ESTBeaconManager delegate
(void)beaconManager:(id)manager monitoringDidFailForRegion:(CLBeaconRegion )region withError:(NSError *)error { UIAlertView errorView = [[UIAlertView alloc] initWithTitle:@"Monitoring error" message:error.localizedDescription delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
[errorView show];
}
@end
after building successfully I have received an error warning :
(KCLErrorDomain error 4.) which is a problem with monitoring the beacons.
Please help me guys, I really appreciate! Thank you