Exemplo n.º 1
0
 public override void DidDetermineState(CLLocationManager manager, CLRegionState state, CLRegion region)
 {
     //base.DidDetermineState(manager, state, region);
     if (state == CLRegionState.Inside)
     {
         manager.StartRangingBeacons(region as CLBeaconRegion);
     }
 }
Exemplo n.º 2
0
 public override void DidDetermineState(CLLocationManager manager, CLRegionState state, CLRegion region)
 {
     //get state on initial call.  App user may already be inide
     //a region upon opening the app.
     if (state == CLRegionState.Inside)
     {
         SetContent(_beaconManager.GetEnterRegionContent(region));
     }
 }
Exemplo n.º 3
0
            public override void DidDetermineState(CLLocationManager manager, CLRegionState state, CLRegion region)
            {
                Debug.WriteLine($"region state determined for {region.Identifier}: {state}", LogTag);

                // trigger region enter if we are already inside the beacon region
                if (state == CLRegionState.Inside)
                {
                    _bluetoothPacketProvider.BeaconRegionEntered?.Invoke(_bluetoothPacketProvider, new BeaconPacketArgs(new BeaconPacket(new BeaconRegion(region.Identifier))));
                }
            }
Exemplo n.º 4
0
 public override void DidDetermineState(NSObject manager, CLRegionState state, CLBeaconRegion region)
 {
     if (state == CLRegionState.Inside)
     {
         Lighthouse.SendBeaconRegionLocationUpdate(Lighthouse.BeaconRegionLocationPhase.ENTER, region.ProximityUuid.ToString(), region.Major.UInt16Value, region.Minor.UInt16Value, region.Identifier);
     }
     else
     {
         Lighthouse.SendBeaconRegionLocationUpdate(Lighthouse.BeaconRegionLocationPhase.EXIT, region.ProximityUuid.ToString(), region.Major.UInt16Value, region.Minor.UInt16Value, region.Identifier);
     }
 }
Exemplo n.º 5
0
 public override void DidDetermineState(ESTBeaconManager manager, CLRegionState state, ESTBeaconRegion region)
 {
     if (state == CLRegionState.Inside)
     {
         vc.SetProductImage();
     }
     else
     {
         vc.SetDiscountImage();
     }
 }
Exemplo n.º 6
0
 public override async void DidDetermineState(CLLocationManager manager, CLRegionState state, CLRegion region)
 {
     if (region is CLCircularRegion native)
     {
         var geofence = await this.repository.Get(native.Identifier);
         if (geofence != null)
         {
             var args = new GeofenceCurrentStatus(geofence, state.FromNative());
             this.stateSubject.OnNext(args);
         }
     }
 }
Exemplo n.º 7
0
        protected virtual GeofenceStatus FromNative(CLRegionState state)
        {
            switch (state)
            {
            case CLRegionState.Inside:
                return(GeofenceStatus.Entered);

            case CLRegionState.Outside:
                return(GeofenceStatus.Exited);

            case CLRegionState.Unknown:
            default:
                return(GeofenceStatus.Unknown);
            }
        }
Exemplo n.º 8
0
        public static GeofenceState FromNative(this CLRegionState state)
        {
            switch (state)
            {
            case CLRegionState.Inside:
                return(GeofenceState.Entered);

            case CLRegionState.Outside:
                return(GeofenceState.Exited);

            case CLRegionState.Unknown:
            default:
                return(GeofenceState.Unknown);
            }
        }
Exemplo n.º 9
0
 public override void DidDetermineState(CLLocationManager manager, CLRegionState state, CLRegion region)
 => this.DeterminedState?.Invoke(this, new CLRegionStateDeterminedEventArgs(state, region));
Exemplo n.º 10
0
        protected virtual GeofenceStatus FromNative(CLRegionState state)
        {
            switch (state)
            {
                case CLRegionState.Inside:
                    return GeofenceStatus.Entered;

                case CLRegionState.Outside:
                    return GeofenceStatus.Exited;

                case CLRegionState.Unknown:
                default:
                    return GeofenceStatus.Unknown;
            }
        }
Exemplo n.º 11
0
 public override void DidDetermineState(CLLocationManager manager, CLRegionState state, CLRegion region)
 {
 }