First of all, I’m new to Estimote iOS SDK and still trying to figure out things correctly. I’ll go through the steps I have followed and at the end will tell the issue.
In my AppDelegate I’m instantiate a ESTBeaconManager object
let beaconManager = ESTBeaconManager()
Then I create two CLBeaconRegions
let clBeaconRegionIce:CLBeaconRegion = CLBeaconRegion(proximityUUID: NSUUID(UUIDString: "MY-UUID")!, major: 1, minor: 2, identifier: "monitored region ice")
let clBeaconRegionBlueberry:CLBeaconRegion = CLBeaconRegion(proximityUUID: NSUUID(UUIDString: "MY-UUID")!, major: 1, minor: 9, identifier: "monitored region blueberry")
After that, I’m start monitoring them while those beacons are in the range
self.beaconManager.startMonitoringForRegion(clBeaconRegionIce)
self.beaconManager.startMonitoringForRegion(clBeaconRegionBlueberry)
My question is following method
func beaconManager(manager: AnyObject, didRangeBeacons beacons: [CLBeacon], inRegion region: CLBeaconRegion)
is calling repeatedly even none of the beacons are active (I removed the batteries from the beacons).
And another thing that I cannot understand is, that CLBeacon reference has major, minor and rssi values and I have no idea where those values assigned and also those values are differ from the values assigned to the beacons in the beacon settings.
As an example
for beacon in beacons {
NSLog("%@ - %@ - %d # beacon.major = %d", TAG, #function, #line, beacon.major)
NSLog("%@ - %@ - %d # beacon.minor = %d", TAG, #function, #line, beacon.minor)
NSLog("%@ - %@ - %d # beacon.rssi = %d", TAG, #function, #line, beacon.rssi)
}
will print
EstimoteAnuja[269:13982] AppDelegate - beaconManager(:didRangeBeacons:inRegion:) - 161 # beacon.major = 19
EstimoteAnuja[269:13982] AppDelegate - beaconManager(:didRangeBeacons:inRegion:) - 162 # beacon.minor = 147
EstimoteAnuja[269:13982] AppDelegate - beaconManager(_:didRangeBeacons:inRegion:) - 163 # beacon.rssi = -77
That prints, even there are no active beacons around.
Once there is an active beacon, it prints expected major and minor values for region property in the same method
region.major = Optional(1)
region.minor = Optional(9)
region.identifier = monitored region blueberry
So, if I summarize my questions;
- Why didRangeBeacons function calls even there are no active beacons around ?
- Where does CLBeacon gets major & minor values?