protected virtual void RegionLeftHandler(object sender, CLRegionEventArgs e) { #if RELEASE Log.LogMessage(string.Format("{0} {1} --- LEFT", e.Region.Center.Latitude, e.Region.Center.Longitude)); #endif StartLocationUpdates(); }
void HandleRegionLeft(object sender, CLRegionEventArgs e) { if (e.Region.Identifier.Equals(roximityBeaconId)) { locationManager.StopRangingBeacons(rBeaconRegion); } }
void RegionLeft(object sender, CLRegionEventArgs e) { if (!GeofenceResults.ContainsKey(e.Region.Identifier) || GeofenceResults[e.Region.Identifier].Transition != GeofenceTransition.Exited) { OnRegionLeft(e.Region); } }
// A location bubble was popped. Notify the server and display the notification string to the user. async void Pop(object sender, CLRegionEventArgs e) { if (!e.Region.Identifier.Equals("RefreshZone")) // Ignore the refresh zone. { // Get the ID of the bubble that was popped. int bubbleId = Int32.Parse(e.Region.Identifier); Debug.WriteLine(">>>>> Popped bubble #" + bubbleId.ToString()); // Notify the server and get notification message. EventMobile localEvent = new EventMobile(); localEvent.BubbleId = bubbleId; localEvent.TimestampJson = DateTime.Now.ToLongTimeString(); string json = await WebApiPost("api/Event", localEvent); EventMobile serverEvent = (EventMobile)JsonConvert.DeserializeObject(json, typeof(EventMobile)); // If the event has not been suppressed, process it. if (!serverEvent.Suppressed) { Debug.WriteLine(">>>>> Processing event: Bubble #" + bubbleId.ToString()); // Display a notification. DisplayNotification(serverEvent.ProviderName, serverEvent.MsgTitle, serverEvent.Msg, "Popdit" + " " + e.Region.Identifier); // If the pops page is displayed, refresh it. UIWebView webView = (UIWebView)UIApplication.SharedApplication.KeyWindow.RootViewController.View; if (webView.Request.Url.AbsoluteString.Contains("Event")) { webView.LoadRequest(new NSUrlRequest(PopditServer.WebRoot)); } } else { Debug.WriteLine(">>>>> Event suppressed: Bubble #" + bubbleId.ToString()); } } }
void LocationManagerRegionEntered(object sender, CLRegionEventArgs e) { var notification = new UILocalNotification(); notification.AlertBody = "Hello iBeacon!"; UIApplication.SharedApplication.PresentLocalNotificationNow(notification); }
void BeaconManagerEnteredRegion(object sender, CLRegionEventArgs e) { var notification = new UILocalNotification(); notification.AlertBody = "Welcome to this beacons talk"; UIApplication.SharedApplication.PresentLocalNotificationNow(notification); }
void HandleRegionLeft (object sender, CLRegionEventArgs e) { if (e.Region.Identifier.Equals (roximityBeaconId)) { locationManager.StopRangingBeacons (rBeaconRegion); } else if (e.Region.Identifier.Equals (estimoteBeaconId)) { locationManager.StopRangingBeacons (eBeaconRegion); } }
void BeaconManagerExitedRegion(object sender, CLRegionEventArgs e) { var notification = new UILocalNotification(); notification.AlertBody = "Goodbye"; UIApplication.SharedApplication.PresentLocalNotificationNow(notification); }
private void _locationManager_RegionEntered(object sender, CLRegionEventArgs e) { lock (_reports) { _reports.Enqueue(new Geofencing.GeofenceStateChangeReport(e.Region, LastKnownGeoposition, GeofenceState.Entered)); } OnGeofenceStateChanged(); }
void LocationManager_RegionLeft(object sender, CLRegionEventArgs e) { nint taskID = UIApplication.SharedApplication.BeginBackgroundTask(() => { }); _logger?.Information($"iOS: Region left {e.Region.Identifier}"); OnRegionLeft?.Invoke(this, new RegionEventArgs(e.Region.Identifier)); UIApplication.SharedApplication.EndBackgroundTask(taskID); }
protected void OnRegionLeft(object sender, CLRegionEventArgs e) { _log.Info ("MonitorGeoFences: Native event: Region left"); var region = GetRegion (e); if (region != null) // TODO: Not tested { RegionLeft (this, region); } }
protected virtual void TryFireEvent(CLRegionEventArgs args, GeofenceStatus status) { if (!(args.Region is CLCircularRegion native)) { return; } var region = FromNative(native); RegionStatusChanged?.Invoke(this, new GeofenceStatusChangedEventArgs(region, status)); }
void HandleRegionEntered(object sender, CLRegionEventArgs e) { Console.WriteLine("Region entered: " + e.Region.Identifier); if (e.Region.Identifier.Equals(roximityBeaconId)) { locationManager.StartRangingBeacons(rBeaconRegion); var notification = new UILocalNotification { AlertBody = "Beacons are in range" }; UIApplication.SharedApplication.PresentLocalNotificationNow(notification); } }
void HandleRegionEntered (object sender, CLRegionEventArgs e) { Console.WriteLine ("Region entered: " + e.Region.Identifier); if (e.Region.Identifier.Equals (roximityBeaconId)) { locationManager.StartRangingBeacons (rBeaconRegion); var notification = new UILocalNotification { AlertBody = "Beacons are in range" }; UIApplication.SharedApplication.PresentLocalNotificationNow (notification); } else if (e.Region.Identifier.Equals (estimoteBeaconId)) { locationManager.StartRangingBeacons (eBeaconRegion); var notification = new UILocalNotification { AlertBody = "Beacons are in range" }; UIApplication.SharedApplication.PresentLocalNotificationNow (notification); } }
protected virtual void DoBroadcast(CLRegionEventArgs args, GeofenceStatus status) { Debug.WriteLine("Firing geofence region event"); var native = args.Region as CLCircularRegion; if (native == null) { return; } var region = this.FromNative(native); this.RegionStatusChanged?.Invoke(this, new GeofenceStatusChangedEventArgs(region, status)); }
private static void LocationManager_RegionLeft(object sender, CLRegionEventArgs e) { MvxTrace.TaggedTrace("Geofencing", "Left region " + e.Region.Identifier); if (e.Region.Identifier == USER_REGION_HEADER) { UpdateRegionLeft?.Invoke(null, EventArgs.Empty); return; } if (!e.Region.Identifier.StartsWith(GEO_REGION_HEADER)) { return; //TODO On Region Lefted } }
Region GetRegion (CLRegionEventArgs e) { var region = e.Region as CLCircularRegion; if (e == null) { return null; } var regionEntries = Regions.Where (i => i.Value.Identifier == region.Identifier); if (regionEntries.Any()) { return regionEntries.First().Key; } return null; }
// The user left the refresh zone. Get a new catalog of bubbles from the server. async void Refresh(object sender, CLRegionEventArgs e) { if (credentials.BasicAuthString.Length > 0 && (e == null || e.Region.Identifier.Equals("RefreshZone"))) // Ignore location bubbles. { // Get the user's location and code it as the bubble zone. CLLocation location = LocMgr.Location; double latitude = location.Coordinate.Latitude; // TBD double double longitude = location.Coordinate.Longitude; // TBD double Debug.WriteLine(">>>>> Refreshing at " + latitude.ToString() + ", " + longitude.ToString()); Location loc = new Location(latitude, longitude); // Get all the bubbles in the zone. string json = await WebApiPost("api/Bubble", loc); BubbleCatalog = (List <BubbleMobile>)JsonConvert.DeserializeObject(json, typeof(List <BubbleMobile>)); // At the last possible moment, delete all the existing bubbles. foreach (CLCircularRegion r in LocMgr.MonitoredRegions) { LocMgr.StopMonitoring(r); } // Set an event handler for each bubble in the new list. foreach (BubbleMobile bubble in BubbleCatalog) { if (bubble.Id == 0) // Refresh zone bubble. { Debug.WriteLine(">>>>> Adding refresh zone"); // Redefine the refresh zone and give it an event handler. CLCircularRegion refreshRegion = new CLCircularRegion(new CLLocationCoordinate2D(latitude, longitude), bubble.Radius, "RefreshZone"); LocMgr.StartMonitoring(refreshRegion); } else // Poppable bubble. { CLCircularRegion bubbleRegion = new CLCircularRegion(new CLLocationCoordinate2D((double)bubble.Latitude, (double)bubble.Longitude), bubble.Radius, bubble.Id.ToString()); LocMgr.StartMonitoring(bubbleRegion); Debug.WriteLine(">>>>> Adding bubble #" + bubble.Id.ToString()); // Check to see if we're already inside the bubble. This will not raise a "RegionEntered" event. if (bubbleRegion.Contains(new CLLocationCoordinate2D(latitude, longitude))) { Debug.WriteLine(">>>>> Inside bubble #" + bubble.Id.ToString() + " before pop"); Pop(null, new CLRegionEventArgs(bubbleRegion)); Debug.WriteLine(">>>>> Inside bubble #" + bubble.Id.ToString() + " after pop"); } } } } }
private static void LocationManager_RegionEntered(object sender, CLRegionEventArgs e) { MvxTrace.TaggedTrace("Geofencing", "Entered region " + e.Region.Identifier); if (e.Region.Identifier == USER_REGION_HEADER) { return; } if (!e.Region.Identifier.StartsWith(GEO_REGION_HEADER)) { return; } string id = e.Region.Identifier.Substring(GEO_REGION_HEADER.Length); RegionEntered?.Invoke(null, id); }
void _clManager_RegionLeft(object sender, CLRegionEventArgs e) { _currentCoreLocationProfile = _currentProfile.HighTrackingProfile; ApplyCoreLocationProfile(_currentCoreLocationProfile); }
private void ExitRegionComplete(object sender, CLRegionEventArgs e) { System.Diagnostics.Debug.WriteLine("ExitRegionComplete ---- StopRanging"); System.Diagnostics.Debug.WriteLine(e.ToString()); _beaconManager.StopRangingBeacons(_fieldRegion); }
public void RegionEnteredDelegate(object sender, CLRegionEventArgs e) { PrepareRangingEventProperties(true, e.Region.Identifier); }
public void RegionLeftDelegate(object sender, CLRegionEventArgs e) { PrepareRangingEventProperties(false, e.Region.Identifier); }
private static void HandleRegionEntered(object sender, CLRegionEventArgs e) { var beaconRegion = e.Region as CLBeaconRegion; Delegate.RegionEnetered (beaconRegion, currentRegion); currentRegion = beaconRegion; }
protected virtual void RegionEnteredHandler(object sender, CLRegionEventArgs e) { #if RELEASE Log.LogMessage(string.Format("{0} {1} --- ENTERED", e.Region.Center.Latitude, e.Region.Center.Longitude)); #endif }
void RegionLeft(object sender, CLRegionEventArgs e) { OnRegionLeft(e.Region); }
void locationMgr_RegionLeft(object sender, CLRegionEventArgs e) { if (ExitedRegion != null) { //IBRegion r = null; if (e.Region != null) { //r = new IBRegion(e.Region.Major, e.Region.Minor, e.Region.ProximityUuid, e.Region.UniqueId); } ExitedRegion(sender, new IBMonitorEventArgs()); } }
static void HandleRegionLeft(object sender, CLRegionEventArgs e) { // if (e.Region.Identifier == regionName){ // Console.WriteLine("beacon region exited"); // } }
protected virtual void DoBroadcast(CLRegionEventArgs args, GeofenceStatus status) { Debug.WriteLine("Firing geofence region event"); var native = args.Region as CLCircularRegion; if (native == null) return; var region = this.FromNative(native); this.RegionStatusChanged?.Invoke(this, new GeofenceStatusChangedEventArgs(region, status)); }
void HandleStartMonitoringForRegion(object sender, CLRegionEventArgs e) { SystemLogger.Log(SystemLogger.Module.PLATFORM, "************************** HandleStartMonitoringForRegion"); }
void HandleDidStartMonitoringForRegion(object sender, CLRegionEventArgs e) { locationManager.RequestState(e.Region); }
private void Manager_RegionEntered(object sender, CLRegionEventArgs e) { Message.InvokeSnackBar("Manager_RegionEntered"); }
static void HandleRegionLeft(object sender, CLRegionEventArgs e) { var beaconRegion = e.Region as CLBeaconRegion; if (currentRegion == null || currentRegion.Identifier != beaconRegion.Identifier) return; Delegate.RegionLeft (beaconRegion); currentRegion = null; }
protected virtual void StartedMonitorRegionHandler(object sender, CLRegionEventArgs e) { #if RELEASE Log.LogMessage(string.Format("{0} {1} START MONITORING", e.Region.Center.Latitude, e.Region.Center.Longitude)); #endif }
private static void HandleDidStartMonitoringForRegion(object sender, CLRegionEventArgs e) { var beaconRegion = e.Region as CLBeaconRegion; Delegate.MonitoringStarted (beaconRegion); }
/// <summary> /// Get called when Region is left /// </summary> /// <param name="sender">Sender who fired the event.</param> /// <param name="e">Event arguemnts</param> private void RegionLeft(object sender, CLRegionEventArgs e) { if (!this.GeofenceResults.ContainsKey(e.Region.Identifier) || this.GeofenceResults[e.Region.Identifier].Transition != GeofenceTransition.Exited) { this.OnRegionLeft(e.Region); } }
/// <summary> /// Dids the start monitoring for region. /// </summary> /// <param name="sender">Sender wo fired the event.</param> /// <param name="e">Event args.</param> private static void DidStartMonitoringForRegion(object sender, CLRegionEventArgs e) { CrossGeofence.GeofenceListener.OnMonitoringStarted(e.Region.Identifier); }
/// <summary> /// Get Called on RegionEntered. /// </summary> /// <param name="sender">Sender who fired the event.</param> /// <param name="e">Event arguemnts</param> private void RegionEntered(object sender, CLRegionEventArgs e) { this.OnRegionEntered(e.Region); }
private void RegionEntered(object sender, CLRegionEventArgs e) { Console.WriteLine("Entered region " + e.Region.Identifier); }
private void RegionLeft(object sender, CLRegionEventArgs e) { Console.WriteLine("Left region " + e.Region.Identifier); }
private void DidRegionLeft(object sender, CLRegionEventArgs e) { _locationMgr.StopRangingBeacons(_fieldRegion); }
private void DidRegionEntered(object sender, CLRegionEventArgs e) { _locationMgr.StartRangingBeacons(_fieldRegion); }
void RegionEntered(object sender, CLRegionEventArgs e) { OnRegionEntered(e.Region); }
void DidStartMonitoringForRegion(object sender, CLRegionEventArgs e) { CrossGeofence.GeofenceListener.OnMonitoringStarted(e.Region.Identifier); }
static void HandleDidStartMonitoringForRegion(object sender, CLRegionEventArgs e) { string t_region = e.Region.Identifier.ToString (); Console.WriteLine (t_region); }