Geolocator.RequestAccessAsync Method


Requests permission to access location data.

 static IAsyncOperation<GeolocationAccessStatus> ^ RequestAccessAsync();
/// [Windows.Foundation.Metadata.RemoteAsync]
 static IAsyncOperation<GeolocationAccessStatus> RequestAccessAsync();
public static IAsyncOperation<GeolocationAccessStatus> RequestAccessAsync();
function requestAccessAsync()
Public Shared Function RequestAccessAsync () As IAsyncOperation(Of GeolocationAccessStatus)



A GeolocationAccessStatus that indicates if permission to location data has been granted.


Windows 10 requirements

App capabilities


The RequestAccessAsync method prompts the user for permission to access their location. The user is only prompted once (per app). After the first time they grant or deny permission, this method no longer prompts for permission. To help the user change location permissions after they've been prompted, we recommend providing a link to the location settings on their device. When the user has given the app some kind of location permissions, your app can work as intended; to determine which type of location tracking is being used, query the PositionSource property of a retrieved Geocoordinate object.


To link to location settings from your app, call the LaunchUriAsync method with the URI ms-settings:privacy-location. For more info, see Launch the Windows Settings app.

Applies to

See also