예제 #1
0
        static async void OnLocatorStatusChanged(Geolocator sender, StatusChangedEventArgs args)
        {
            switch (args.Status)
            {
            case PositionStatus.NoData:
                await StopTracking();

                await Thread.Pool.Run(() => PositionError.Raise(new Exception(UNAVAILABLE_ERROR)));

                return;

            case PositionStatus.Disabled:
                await StopTracking();

                await Thread.Pool.Run(() => PositionError.Raise(new Exception(UNAUTHORISED_ERROR)));

                return;

            default: return;
            }
        }
예제 #2
0
 static Task OnListenerPositionError(Exception error) => StopTracking().ContinueWith(x => PositionError.Raise(error));