Hi guys,
i'm facing one big problem with regions.
My app is detecting when i enter a region with my bluetooth on.
But when i'm already inside the region and then turn on the bluetooth, nothing happens. It just don't detect the region and/or the beacons.
Does anyone have the same problem?
How to solve this?
Hey Filipa—did you implement a didEnterRegion
callback? In and on itself, the enter event doesn't trigger anything, it's up to your implementation of the callback. Can you share what you're trying to achieve, maybe I'll be able to help?
Cheers.
Hi Piotr,
I did implement that callback. But it isn't called when I turn the bluetooth on when i'm already inside the region.
Ah, got ya, misunderstood the question, sorry about that!
You can use the requestStateForRegion coupled with the didDetermineState delegate to figure out if you're inside out outside a region.
I'd probably put this requestStateForRegion call inside the Core Bluetooth's centralManagerDidUpdateState
delegate, which enables you to detect changes in the Bluetooth state (i.e. on/off). This blog post describes that part in greater detail:
http://chris.cm/determine-whether-bluetooth-is-enabled-on-ios-passively/