OptionalresetReset the plugin to its initial state before applying this configuration. This is probably what you want.
Defaults to true
If you set this to false, the SDK will consume your Config only at the first install of your app. Thereafter, the only way
to change your configuration will be to call BackgroundGeolocation.setConfig,
You will certainly NOT want to use reset: false during development, as it will prevent your configuration changes from taking effect on subsequent app launches.
OptionalloggerLogger configuration.
OptionalgeolocationGeolocation configuration.
OptionalhttpHTTP configuration.
OptionalappApp configuration.
OptionalpersistencePersistence configuration.
OptionalactivityMotion Activity configuration.
OptionalauthorizationAuthorization configuration.
OptionaltransistorConvenience option to automatically configures the SDK to upload locations to the Transistor Software demo server at http://tracker.transistorsoft.com (or your own local instance of background-geolocation-console)
See TransistorAuthorizationService. This option will automatically configure the HttpConfig.url to point at the Demo server as well as well as the required AuthorizationConfig configuration.
const token = await
BackgroundGeolocation.findOrCreateTransistorAuthorizationToken("my-company-name", "my-username");
BackgroundGeolocation.ready({
transistorAuthorizationToken: token
});
This convenience option merely performs the following [[Authorization]] configuration automatically for you:
// Base url to Transistor Demo Server.
const url = "http://tracker.transistorsoft.com";
// Register for an authorization token from server.
const token = await
BackgroundGeolocation.findOrCreateTransistorAuthorizationToken("my-company-name", "my-username");
BackgroundGeolocation.ready({
url: url + "/api/locations",
authorization: {
strategy: "JWT",
accessToken: token.accessToken,
refreshToken: token.refreshToken,
refreshUrl: url + "/v2/refresh_token",
refreshPayload: {
refresh_token: "{refreshToken}"
},
expires: token.expires
}
});
Configuration API.
The
Configclass defines all SDK options, grouped into compound configuration objects:Instances of
Configare consumed by BackgroundGeolocation.ready and BackgroundGeolocation.setConfig.Example