TransistorAuthorizationToken class
Use TransistorAuthorizationToken.findOrCreate to generate an Authorization token suitable for configuring the SDK's Authorization with Transistor Software's Demo Server at http://tracker.transistorsoft.com.
You may also run your own instance of Demo Server locally. See background-geolocation-console
The test server is a great way to debug location problems or evalute the SDK's behaviour, since the results can easily be shared with Transistor Software when requesting support.
Example
String orgname = "my-company-name";
String usernmae = "my-username";
// Fetch an authoriztion token from server.
// The SDK will cache the received token and return it if found locally.
TransistorAuthorizationToken token = await
TransistorAuthorizationToken.findOrCreate(orgname, username);
BackgroundGeolocation.ready(Config(
transistorAuthorizationToken: token
))
Viewing Your Tracking Results
To view your tracking results in the browser, use your configured "Organization Name" and visit:
Constructors
- TransistorAuthorizationToken(String accessToken, String refreshToken, int expires, String url)
Properties
- accessToken ↔ String
-
The authorization token to provide to Authorization.accessToken
getter/setter pair
-
Returns Authorization instance suitable for consumption by Config.authorization.
See Config.transistorAuthorizationToken
no setter
- expires ↔ int
-
The expiry time of the Authorization.accessToken
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- locationsUrl → String
-
Return full url to
/locations
endpoint.no setter -
refreshPayload
→ Map<
String, String> -
Return
Map
of refreshPayload.no setter - refreshToken ↔ String
-
The token used to request to provide to Authorization.refreshToken
getter/setter pair
- refreshUrl → String
-
Return full url to refreshUrl endpoint.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- url ↔ String
-
The base-url of Transistor Demo server where this token came from.
Read only
getter/setter pair
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → String - JSON represention of token.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
destroy(
String url) → Future< bool?> - Destroys the cached Transistor JSON Web Token used to authorize with the Demo Server at http://tracker.transistorsoft.com or your local instance of background-geolocation-console
-
findOrCreate(
String orgname, String username, [String url = _DEFAULT_TRANSISTOR_URL]) → Future< TransistorAuthorizationToken> - Returns a JSON Web Token (JWT) suitable for Authorization with the Transistor Software demo server at http://tracker.transistorsoft.com.
Constants
- FIELD_ACCESS_TOKEN → const String
- FIELD_EXPIRES → const String
- FIELD_REFRESH_TOKEN → const String