Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 77050

How to catch A geolocation error occured: PositionUnavailable?

$
0
0

I'm getting crashes with the unhandled exception "A geolocation error occured: PositionUnavailable"

But the only place that I think I am calling anything geolocation related is the following:

try
            {
                await geolocator.GetPositionAsync(timeout: 10000, cancelToken: cancelSource.Token, includeHeading: true)
                    .ContinueWith(t =>
                    {
            // Some code to set the center
                    });
            }
            catch (XLabs.Platform.Services.Geolocation.GeolocationException)
            {
                // we just ignore it...
            }

I guess my questions are, is this going to catch the exception (and if so, why isn't unhandled)
and is there something else that is trying to use the location and thus throwing this exception?


Viewing all articles
Browse latest Browse all 77050

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>