Monitoring a Region
A region of beacons is designated by a UUID and a simple identifier. You should always supply a valid UUID string that matches the UUID used in your beacons and a simple identifier to allow the system to distinguish regions internally.
During the lifetime of monitoring a region you'll receive the following events:
REGION_MONITORING_START: when monitoring of a region begins
REGION_ENTER: when a region is entered by a device
REGION_EXIT: when a region is left by a device
BEACON_UPDATE: when a beacon is detected and ranged within a region
When the application is in the foreground, a region change detection can take ~ 1 second.
" In general ranging only works in the foreground, but monitoring updates can happen in the background. There are two ways to configure background monitoring, and even when done properly updates can take a long time to come. Because these delays, some people mistakenly believe that monitoring in the background doesn't work. "
iOS: On iOS you must ensure you have the
ALWAYSpermission granted to successfully monitor regions. Without this permission you may not get any region entry or exit events.
To start the monitoring call the
startMonitoringRegionWithUUID function with your
Then setup event handlers as below:
If you wish to monitor multiple regions simulataneously you must make sure that the identifier parameter is unique for each region as well as the uuid! If you do not you will only receive updates for the last region you started monitoring. The iOS SDK uses the identifier to determine if the region is unique, and replaces any existing region monitoring if it is the same.
Similarly to stop monitoring call the