Hi, I’ve started implement EstimoteSDK with non- secure UUID, it’s work fine. After i’ve try to used secure UUID.
I’ve problem with delegate beaconManager:didDetermineState:forRegion: it’s always return CLRegionStateOutside
and after flip my beacon for more than 30 second delegate it’s not call outside
here is my sample code
- (void)initial {
[ESTConfig setupAppID:BEACON_APP_ID andAppToken:APP_TOKEN];
if ([ESTConfig isAuthorized]) {
self.secureBeaconManager = [ESTSecureBeaconManager new];
self.secureBeaconManager.delegate = self;
[self.secureBeaconManager requestAlwaysAuthorization];
self.beaconRegion = [[CLBeaconRegion alloc] initWithProximityUUID:[[NSUUID alloc] initWithUUIDString:BEACON_UUID]
identifier:BEACON_IDENTIFIER];
self.currentStage = CLRegionStateUnknown;
[self.secureBeaconManager startRangingBeaconsInRegion:self.beaconRegion];
[self.secureBeaconManager startMonitoringForRegion:self.beaconRegion];
}
}
- (void)beaconManager:(id)manager didDetermineState:(CLRegionState)state forRegion:(nonnull CLBeaconRegion *)region {
if (state == CLRegionStateInside) {
if (self.currentStage != CLRegionStateInside) {
// Say hi
UILocalNotification *notification = [UILocalNotification new];
notification.alertBody = @"Say hi";
[[UIApplication sharedApplication] presentLocalNotificationNow:notification];
}
} else if (state == CLRegionStateOutside) {
if (self.currentStage == CLRegionStateInside) {
// Say bye
UILocalNotification *notification = [[UILocalNotification alloc] init];
notification.alertBody = @"Say bye";
[[UIApplication sharedApplication] presentLocalNotificationNow:notification];
}
}
// Update State
self.currentStage = state;
}
- (void)beaconManager:(id)manager didRangeBeacons:(NSArray<CLBeacon *> *)beacons inRegion:(CLBeaconRegion *)region {
if (beacons.count > 0) {
CLBeacon *beacon = beacons.firstObject;
self.currentBeacon = beacon;
[self.secureBeaconManager requestStateForRegion:self.beaconRegion];
}
}