locationManager.MonitoredRegions includes all CLCircularRegion and CLBeaconRegions which are monitored. If you're monitoring beacons within the app, they will be in the MonitoredRegions collection.
Since this component only focusses on geolocations, it makes sense to cast as follows (otherwise System.InvalidCastException: Specified cast is not valid is thrown )
foreach (var mRegion in monitoredRegions)
{
var region = mRegion as CLCircularRegion;
if (region == null)
{
continue;
}
//If not on regions remove on startup since that region was set not persistent
if (!Regions.ContainsKey(region.Identifier))
{
locationManager.StopMonitoring(region);
}
else
{
locationManager.RequestState(region);
}
}
This occurs in the constructor as well as LocationsUpdated().
Hopefully this change can go in for the next update.
locationManager.MonitoredRegions includes all CLCircularRegion and CLBeaconRegions which are monitored. If you're monitoring beacons within the app, they will be in the MonitoredRegions collection. Since this component only focusses on geolocations, it makes sense to cast as follows (otherwise System.InvalidCastException: Specified cast is not valid is thrown )
NSSet monitoredRegions = locationManager.MonitoredRegions;
This occurs in the constructor as well as LocationsUpdated().
Hopefully this change can go in for the next update.