void HandleDidRangeBeacons(object sender, CLRegionBeaconsRangedEventArgs e) { Unknowns.Clear(); Immediates.Clear(); Nears.Clear(); Fars.Clear(); foreach (CLBeacon beacon in e.Beacons) { switch (beacon.Proximity) { case CLProximity.Immediate: Immediates.Add(beacon); break; case CLProximity.Near: Nears.Add(beacon); break; case CLProximity.Far: Fars.Add(beacon); break; case CLProximity.Unknown: Unknowns.Add(beacon); break; } } TableView.ReloadData(); }
void HandleDidRangeBeacons(object sender, CLRegionBeaconsRangedEventArgs e) { Unknowns.Clear(); Immediates.Clear(); Nears.Clear(); Fars.Clear(); SystemLogger.Log(SystemLogger.Module.PLATFORM, "************************** HandleDidRangeBeacons Identifier: " + e.Region.Identifier); int i = 0; foreach (CLBeacon beacon in e.Beacons) { switch (beacon.Proximity) { case CLProximity.Immediate: Immediates.Add(beacon); break; case CLProximity.Near: Nears.Add(beacon); break; case CLProximity.Far: Fars.Add(beacon); break; case CLProximity.Unknown: Unknowns.Add(beacon); break; } SystemLogger.Log(SystemLogger.Module.PLATFORM, "************************** HandleDidRangeBeacons Accuracy: " + beacon.Accuracy); SystemLogger.Log(SystemLogger.Module.PLATFORM, "************************** HandleDidRangeBeacons Proximity: " + beacon.Proximity); SystemLogger.Log(SystemLogger.Module.PLATFORM, "************************** HandleDidRangeBeacons Description: " + beacon.Description); SystemLogger.Log(SystemLogger.Module.PLATFORM, "************************** HandleDidRangeBeacons Major: " + beacon.Major); SystemLogger.Log(SystemLogger.Module.PLATFORM, "************************** HandleDidRangeBeacons Minor: " + beacon.Minor); SystemLogger.Log(SystemLogger.Module.PLATFORM, "************************** HandleDidRangeBeacons Rssi: " + beacon.Rssi); SystemLogger.Log(SystemLogger.Module.PLATFORM, "************************** HandleDidRangeBeacons ProximityUuid: " + beacon.ProximityUuid); Beacon AppverseBeacon = FromCLBeacon(beacon); String id = uniqueIDForBeacon(AppverseBeacon); if (!rangingBeacons.ContainsKey(id)) { SystemLogger.Log(SystemLogger.Module.PLATFORM, "************************** ADDED LOCATION: " + AppverseBeacon.Distance.ToString()); rangingBeacons.Add(id, AppverseBeacon); } else { rangingBeacons[id] = AppverseBeacon; } } }