refreshUrl property

String? refreshUrl
getter/setter pair

The url to your authorization server that provides new accessToken when expired.

When the SDK receives a response the server, it will decode the JSON and recursively iterate through the keys, performing regular expressions and other String-analysis to "taste" the data in search of the following 3 items:

  1. "access token"
  2. "refresh token"
  3. "expiry time"

The SDK is designed to operate with any response data-structure. For example, one authorization server might return a complex response such as:

{
  "token": {
    "access_token": "XXX.YYY.ZZZ",
    "expires_at": 3900
  },
  "refresh_token": "smTsfaspfgaadsfgqZerUt0wueflasdfkaxjdfeKIacb"
}

While another server might return a flat response, such as:

{
 "accessToken": "XXX.YYY.ZZZ",
 "refreshToken": "smTsfaspfgaadsfgqZerUt0wueflasdfkaxjdfeKIacb",
 "expiry": 3900
}

When the response from the server is received, the event BackgroundGeolocation.onAuthorization will be fired, provided with the AuthorizationEvent.

Implementation

String? refreshUrl;