refreshPayload property

Map? refreshPayload
getter/setter pair

Form fields sent to refreshUrl in the application/x-www-form-urlencoded body.

Requirements

  • String values only. All entries in refreshPayload must be String values. If you have non‑string types (e.g., bool, int, Map), convert them to strings first.
  • Refresh token placeholder. You must include exactly one field whose value is the template "{refreshToken}". At runtime, the SDK replaces this placeholder with the configured refreshToken.
  • Encoding. The payload is always encoded as application/x-www-form-urlencoded.

Example

BackgroundGeolocation.ready(Config(
  authorization: Authorization(
    strategy: "JWT",
    accessToken: "XXX.YYY.ZZZ",
    refreshUrl: "https://auth.domain.com/tokens",
    refreshToken: "smTsfaspfgaadsfgqZerUt0wueflasdfkaxjdfeKIacb",
    refreshPayload: {
      "grant_type": "refresh_token",
      "refresh_token": "{refreshToken}",   // <-- will be replaced with the configured refreshToken
      "rememberMe": "true"                 // <-- non-strings must be stringified
    }
  )
));

Implementation

Map? refreshPayload;