예제 #1
0
 protected async override void OnAppearing()
 {
     GeolocationManager = new GeolocationManager(this);
     if (GeolocationManager.IsGpsEnabledAsync().Result)
     {
         InitUserLocation();
     }
     else
     {
         await PopupNavigation.Instance.PushAsync(new MessageBox("Your Gps position could not be extracted, please turn on your gps and please ensure you have internet before you try again", MessageType.Gps, this, this));
     }
 }
예제 #2
0
        protected async override void OnAppearing()
        {
            try
            {
                GeolocationManager = new GeolocationManager(this);
                var enabled = await GeolocationManager.IsGpsEnabledAsync();

                if (enabled)
                {
                    InitUserLocation();
                }
                else
                {
                    await PopupNavigation.Instance.PushAsync(new MessageBox("Your Gps position could not be extracted, please turn on your gps and please ensure you have internet before you try again", MessageType.Gps, this, this));
                }
            }
            catch (Exception ex)
            {
                await PopupNavigation.Instance.PushAsync(new MessageBox(ex.StackTrace, MessageType.Regular, this, this));
            }
        }