Esempio n. 1
0
 static void OnAuthorizationChanged(object sender, CLAuthorizationChangedEventArgs e)
 {
     if (e.Status == CLAuthorizationStatus.Denied || e.Status == CLAuthorizationStatus.Restricted)
     {
         PositionError.RaiseOn(Thread.Pool, new Exception(UNAUTHORISED_ERROR));
     }
 }
Esempio n. 2
0
        static async void OnFailed(object sender, NSErrorEventArgs e)
        {
            var error = (CLError)(int)e.Error.Code;

            if (error == CLError.Network)
            {
                await PositionError.RaiseOn(Thread.Pool, new Exception(UNAVAILABLE_ERROR));
            }

            if (error == CLError.Denied)
            {
                await PositionError.RaiseOn(Thread.Pool, new Exception(UNAUTHORISED_ERROR));
            }
        }