Exemplo n.º 1
0
        private void OnGeolocatorOnPositionChanged(Geolocator sender, PositionChangedEventArgs configureCallbackTokenargs)
        {
            if (Geolocator.LocationStatus == PositionStatus.Disabled || Geolocator.LocationStatus == PositionStatus.NotAvailable)
            {
                DispatchMessage(PluginResult.Status.ERROR, string.Format("Cannot start: LocationStatus/PositionStatus: {0}! {1}", Geolocator.LocationStatus, IsConfigured), true, ConfigureCallbackToken);
                return;
            }

            var callbackJsonResult = configureCallbackTokenargs.Position.Coordinate.ToJson();

            if (BackgroundGeoLocationOptions.Debug)
            {
                DebugAudioNotifier.GetDebugAudioNotifier().PlaySound(DebugAudioNotifier.Tone.High, TimeSpan.FromSeconds(3));
                Debug.WriteLine("PositionChanged token{0}, Coordinates: {1}", ConfigureCallbackToken, callbackJsonResult);
            }

            DispatchMessage(PluginResult.Status.OK, callbackJsonResult, true, ConfigureCallbackToken);
        }
Exemplo n.º 2
0
 public static DebugAudioNotifier GetDebugAudioNotifier()
 {
     return(_audioNotifier ?? (_audioNotifier = new DebugAudioNotifier()));
 }
 public static DebugAudioNotifier GetDebugAudioNotifier()
 {
     return _audioNotifier ?? (_audioNotifier = new DebugAudioNotifier());
 }