示例#1
0
 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();
 }
示例#2
0
 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);
     }
 }
示例#4
0
        // 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);
        }
示例#6
0
        void BeaconManagerEnteredRegion(object sender, CLRegionEventArgs e)
        {
            var notification = new UILocalNotification();

            notification.AlertBody = "Welcome to this beacons talk";

            UIApplication.SharedApplication.PresentLocalNotificationNow(notification);
        }
示例#7
0
		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);
			}
		}
示例#8
0
        void BeaconManagerEnteredRegion(object sender, CLRegionEventArgs e)
        {
            var notification = new UILocalNotification();

            notification.AlertBody = "Welcome to this beacons talk";

            UIApplication.SharedApplication.PresentLocalNotificationNow(notification);
        }
示例#9
0
        void BeaconManagerExitedRegion(object sender, CLRegionEventArgs e)
        {
            var notification = new UILocalNotification();

            notification.AlertBody = "Goodbye";

            UIApplication.SharedApplication.PresentLocalNotificationNow(notification);
        }
示例#10
0
        void BeaconManagerExitedRegion(object sender, CLRegionEventArgs e)
        {
            var notification = new UILocalNotification();

            notification.AlertBody = "Goodbye";

            UIApplication.SharedApplication.PresentLocalNotificationNow(notification);
        }
示例#11
0
        private void _locationManager_RegionEntered(object sender, CLRegionEventArgs e)
        {
            lock (_reports)
            {
                _reports.Enqueue(new Geofencing.GeofenceStateChangeReport(e.Region, LastKnownGeoposition, GeofenceState.Entered));
            }

            OnGeofenceStateChanged();
        }
示例#12
0
        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);
			}
		}
示例#14
0
        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));
        }
示例#15
0
 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);
     }
 }
示例#16
0
		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);
			}
		}
示例#17
0
        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;
		}
示例#20
0
        // 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);
        }
示例#22
0
 void _clManager_RegionLeft(object sender, CLRegionEventArgs e)
 {
     _currentCoreLocationProfile = _currentProfile.HighTrackingProfile;
     ApplyCoreLocationProfile(_currentCoreLocationProfile);
 }
示例#23
0
 private void ExitRegionComplete(object sender, CLRegionEventArgs e)
 {
     System.Diagnostics.Debug.WriteLine("ExitRegionComplete ---- StopRanging");
     System.Diagnostics.Debug.WriteLine(e.ToString());
     _beaconManager.StopRangingBeacons(_fieldRegion);
 }
示例#24
0
 public void RegionEnteredDelegate(object sender, CLRegionEventArgs e)
 {
     PrepareRangingEventProperties(true, e.Region.Identifier);
 }
示例#25
0
 public void RegionLeftDelegate(object sender, CLRegionEventArgs e)
 {
     PrepareRangingEventProperties(false, e.Region.Identifier);
 }
示例#26
0
        private static void HandleRegionEntered(object sender, CLRegionEventArgs e)
        {
            var beaconRegion = e.Region as CLBeaconRegion;

            Delegate.RegionEnetered (beaconRegion, currentRegion);

            currentRegion = beaconRegion;
        }
示例#27
0
 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
 }
示例#28
0
 void RegionLeft(object sender, CLRegionEventArgs e)
 {
     OnRegionLeft(e.Region);
 }
示例#29
0
 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());
     }
 }
示例#30
0
 static void HandleRegionLeft(object sender, CLRegionEventArgs e)
 {
     //			if (e.Region.Identifier == regionName){
     //				Console.WriteLine("beacon region exited");
     //			}
 }
示例#31
0
        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));
        }
示例#32
0
 void HandleStartMonitoringForRegion(object sender, CLRegionEventArgs e)
 {
     SystemLogger.Log(SystemLogger.Module.PLATFORM, "************************** HandleStartMonitoringForRegion");
 }
 void LocationManagerRegionEntered(object sender, CLRegionEventArgs e)
 {
     var notification = new UILocalNotification();
     notification.AlertBody = "Hello iBeacon!";
     UIApplication.SharedApplication.PresentLocalNotificationNow(notification);
 }
 void HandleDidStartMonitoringForRegion(object sender, CLRegionEventArgs e)
 {
     locationManager.RequestState(e.Region);
 }
示例#35
0
 private void Manager_RegionEntered(object sender, CLRegionEventArgs e)
 {
     Message.InvokeSnackBar("Manager_RegionEntered");
 }
示例#36
0
        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;
        }
示例#37
0
 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
 }
示例#38
0
        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);
 }
示例#42
0
 private void RegionEntered(object sender, CLRegionEventArgs e)
 {
     Console.WriteLine("Entered region " + e.Region.Identifier);
 }
示例#43
0
 private void RegionLeft(object sender, CLRegionEventArgs e)
 {
     Console.WriteLine("Left region " + e.Region.Identifier);
 }
示例#44
0
 private void DidRegionLeft(object sender, CLRegionEventArgs e)
 {
     _locationMgr.StopRangingBeacons(_fieldRegion);
 }
示例#45
0
 void HandleStartMonitoringForRegion(object sender, CLRegionEventArgs e)
 {
     SystemLogger.Log(SystemLogger.Module.PLATFORM, "************************** HandleStartMonitoringForRegion");
 }
示例#46
0
 private void DidRegionEntered(object sender, CLRegionEventArgs e)
 {
     _locationMgr.StartRangingBeacons(_fieldRegion);
 }
 void RegionEntered(object sender, CLRegionEventArgs e)
 {
     OnRegionEntered(e.Region);
 }
 void RegionEntered(object sender, CLRegionEventArgs e)
 {
     
     OnRegionEntered(e.Region);
   
 }
 void DidStartMonitoringForRegion(object sender, CLRegionEventArgs e)
 {
     CrossGeofence.GeofenceListener.OnMonitoringStarted(e.Region.Identifier);
 }
示例#50
0
 static void HandleDidStartMonitoringForRegion(object sender, CLRegionEventArgs e)
 {
     string t_region = e.Region.Identifier.ToString ();
     Console.WriteLine (t_region);
 }