params property

Map<String, dynamic>? params
final

Optional HTTP params appended to the JSON body of each HTTP request.

Example

BackgroundGeolocation.ready(Config(
  http: HttpConfig(
    url: 'https://my-server.com/locations',
    params: {
      'user_id': 1234,
      'device_id': 'abc123',
    },
  ),
));

Observing the HTTP request arriving at your server:

POST /locations
 {
  "location": {
    "coords": {
      "latitude": 45.51927004945047,
      "longitude": -73.61650072045029
      .
      .
      .
    }
  },
  "user_id": 1234,  // <-- params appended to the data.
  "device_id": 'abc123'
}

See also: HTTP Guide at HttpConfig.

Implementation

final Map<String, dynamic>? params;