accuracyAuthorization property
[Precise: On]
switch on the location authorization dialog allowing users to disable high-accuracy location.
This attribute shows the state of that switch:
- Enabled: ProviderChangeEvent.ACCURACY_AUTHORIZATION_FULL.
- Disabled, ProviderChangeEvent.ACCURACY_AUTHORIZATION_REDUCED.
Example
BackgroundGeolocation.onProviderChange((ProviderChangeEvent event) {
int authorizationStatus = event.authorizationStatus;
if (authorizationStatus == ProviderChangeEvent.ACCURACY_AUTHORIZATION_REDUCED) {
BackgroundGeolocaiton.requestTemporaryFullAccuracy("MyPurposeString").then((int accuracyAuthorization) {
print("RESULT: $accuracyAuthorization");
}).catchError((error) {
print("ERROR: Failed to show dialog: $error");
});
}
});
See also:
Implementation
late int accuracyAuthorization;