コード例 #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);
     }
 }
コード例 #3
0
 void RegionLeft(object sender, CLRegionEventArgs e)
 {
     if (!GeofenceResults.ContainsKey(e.Region.Identifier) || GeofenceResults[e.Region.Identifier].Transition != GeofenceTransition.Exited)
     {
         OnRegionLeft(e.Region);
     }
 }
コード例 #4
0
ファイル: LocationManager.cs プロジェクト: PHOETUS/Popdit
        // 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());
                }
            }
        }
コード例 #5
0
        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
ファイル: BeaconLocateriOS.cs プロジェクト: joagwa/EasyTechy
		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);
        }
コード例 #13
0
		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
ファイル: BeaconLocateriOS.cs プロジェクト: joagwa/EasyTechy
		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));
        }
コード例 #18
0
        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
            }
        }
コード例 #19
0
		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
ファイル: LocationManager.cs プロジェクト: PHOETUS/Popdit
        // 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");
                        }
                    }
                }
            }
        }
コード例 #21
0
        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
ファイル: iBeacon.cs プロジェクト: JohnGavilan/IBeaconDemo
 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
ファイル: TheBeacon.cs プロジェクト: BorisFR/astromech
 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");
 }
コード例 #33
0
 void LocationManagerRegionEntered(object sender, CLRegionEventArgs e)
 {
     var notification = new UILocalNotification();
     notification.AlertBody = "Hello iBeacon!";
     UIApplication.SharedApplication.PresentLocalNotificationNow(notification);
 }
コード例 #34
0
 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);
        }
コード例 #39
0
 /// <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);
     }
 }
コード例 #40
0
 /// <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); 
 }
コード例 #41
0
 /// <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);
 }
コード例 #47
0
 void RegionEntered(object sender, CLRegionEventArgs e)
 {
     OnRegionEntered(e.Region);
 }
コード例 #48
0
 void RegionEntered(object sender, CLRegionEventArgs e)
 {
     
     OnRegionEntered(e.Region);
   
 }
コード例 #49
0
 void DidStartMonitoringForRegion(object sender, CLRegionEventArgs e)
 {
     CrossGeofence.GeofenceListener.OnMonitoringStarted(e.Region.Identifier);
 }
コード例 #50
0
ファイル: TheBeacon.cs プロジェクト: BorisFR/astromech
 static void HandleDidStartMonitoringForRegion(object sender, CLRegionEventArgs e)
 {
     string t_region = e.Region.Identifier.ToString ();
     Console.WriteLine (t_region);
 }