# Location Data

MBAudience let you track and target user based on their location. Location is sent to MBurger only if it's distant at least 100m from the last location seen by the SDK.

To start monitoring for location changes call, it will continue monitoring until the stop method is called:

```dart
MBAudience.startLocationUpdates();
```

To stop monitoring location changes you have to call:

```dart
MBAudience.stopLocationUpdates();
```

If you want to implement your location logic yoou can always tell `MBAudience` location data with:

```dart
MBAudience.setCurrentLocation(latitude, longitude);
```

**iOS**

The framework uses the method [startMonitoringSignificantLocationChanges](https://developer.apple.com/documentation/corelocation/cllocationmanager/1423531-startmonitoringsignificantlocati) of the CoreLocation manager with an accuracy of `kCLLocationAccuracyHundredMeters`. To start monitoring for location changes call, it will continue monitoring until the stop method is called:

**Android**

MBAudience let you track and target user based on their location, the framework uses a foreground `FusedLocationProviderClient` with priority `PRIORITY_BALANCED_POWER_ACCURACY` which is killed the moment the app goes in background. If you wish to track user position while app is in background you need to implement your own location service, then when you have a new location you can use this API to send it to the framework: `setCurrentLocation(latitude, longitude)`


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.ep.mburger.cloud/flutter-docs/audience/location-data.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
