Geolocation.GetLocationAsync Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
GetLocationAsync() |
Returns the current location of the device. |
GetLocationAsync(GeolocationRequest) |
Returns the current location of the device using the specified criteria. |
GetLocationAsync(GeolocationRequest, CancellationToken) |
Returns the current location of the device using the specified criteria. |
GetLocationAsync()
GetLocationAsync(GeolocationRequest)
Returns the current location of the device using the specified criteria.
public static System.Threading.Tasks.Task<Xamarin.Essentials.Location> GetLocationAsync (Xamarin.Essentials.GeolocationRequest request);
Parameters
- request
- GeolocationRequest
The criteria to use when determining the location of the device.
Returns
Returns the location.
Applies to
GetLocationAsync(GeolocationRequest, CancellationToken)
Returns the current location of the device using the specified criteria.
public static System.Threading.Tasks.Task<Xamarin.Essentials.Location> GetLocationAsync (Xamarin.Essentials.GeolocationRequest request, System.Threading.CancellationToken cancelToken);
Parameters
- request
- GeolocationRequest
The criteria to use when determining the location of the device.
- cancelToken
- CancellationToken
A token for cancelling the operation.
Returns
Returns the location.
Applies to
Xamarin.Essentials
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for