Background geolocation tracker for internal purposes.
npm install bglocng17
npx cap sync
echo(options: { value: string; }) => Promise<{ value: string; }>
Param |
Type |
options |
{ value: string; } |
Returns: Promise<{ value: string; }>
checkPermissions() => Promise<PermissionStatus>
Returns: Promise<PermissionStatus>
requestPermissions() => Promise<PermissionStatus>
Returns: Promise<PermissionStatus>
start(config: InfaBgLocConfig) => Promise<void>
getLocations(options: InfaBgLocFetchOptions) => Promise<InfaBgLocationArray>
Returns: Promise<InfaBgLocationArray>
getStoredLocationsCount()
getStoredLocationsCount() => Promise<InfaBgLocationCount>
Returns: Promise<InfaBgLocationCount>
getAll() => Promise<InfaBgLocationArray>
Returns: Promise<InfaBgLocationArray>
confirmReception(options: InfaBgLocConfirmReceptionOptions) => Promise<void>
upload(config: InfaBgLocSessionConfig) => Promise<void>
cleanup(options?: InfaBgLocCleanupSessionOptions | InfaBgLocCleanupByIdsOptions | undefined) => Promise<void>
addListener(eventName: string, listenerFunc: ListenerCallback) => Promise<PluginListenerHandle> & PluginListenerHandle
Returns: Promise<PluginListenerHandle> & PluginListenerHandle
on(eventName: string) => Observable<any>
Param |
Type |
eventName |
string |
Returns: Observable<any>
Used to configure the background service
Prop |
Type |
items |
InfaBgLocation[] |
Prop |
Type |
id |
number |
sessionToken |
string |
time |
number |
latitude |
number |
longitude |
number |
altitude |
number |
speed |
number |
bearing |
number |
angularSpeed |
number |
accuracy |
number |
verticalAccuracy |
number |
speedAccuracy |
number |
bearingAccuracy |
number |
angularSpeedAccuracy |
number |
nanos |
number |
provider |
string |
latitudeRaw |
number |
longitudeRaw |
number |
Prop |
Type |
Description |
Default |
sessionToken |
string |
Set the session to retrieve the locations for. (required) |
|
limit |
number |
Limits the number of returned locations and retrieves the oldest entries. |
null |
ignoreTransmissionFlag |
boolean |
Get the entire dataset for this session, regardless of the current app-transmission flag. |
false |
InfaBgLocConfirmReceptionOptions
Prop |
Type |
Description |
sessionToken |
string |
Set the session to confirm the reception |
ids |
number[] |
Set the array of ids handled within the application to mark all locations within the native plugin as handled up to this one. |
Prop |
Type |
Description |
Default |
sessionToken |
string |
|
|
httpUrl |
string |
If set, the service will post the recorded locations to the given server url end-point as soon as there is a valid internet connection available. The data will be sent as POST-Method and (actually) without any authorization header. Therefore the end-point should allow anonymous access. |
null |
httpPostTemplate |
string |
Defines the JSON-based template used for sending a location to the server. Please use the following wildcards as desired: - %id% (the auto-incremental identifier for every recorded location) - %sessionToken% (the identifier used for the particular recording session) - %apiSendStatus% (retrieves 0 or 1, whether the location has been flagged to already be sent to the server) - %appSendStatus% (retrieves 0 or 1, whether the location has been flagged to already be collected by the app itself) - %time% (the location's UTC time fix, in milliseconds since epoch (January 1, 1970).) - %latitude% (the latitude, in degrees) - %longitude% (the longitude, in degrees) - %altitude% (the altitude if available, in meters above the WGS 84 reference ellipsoid.) - %speed% (the speed if it is available, in meters/second over ground.) - %bearing% (the bearing, in degrees [0..360]) - %horizontalAccuracy% (the estimated horizontal accuracy of this location, radial, in meters.) - %verticalAccuracy% (the estimated vertical accuracy of this location, in meters.) - %speedAccuracy% (the estimated speed accuracy of this location, in meters per second.) - %bearingAccuracy% (the estimated bearing accuracy of this location, in degrees.) - %nanos% (the time of this fix, in elapsed real-time since system boot.) - %provider% (the name of the provider that generated this fix.) |
|
httpAuthentication |
string |
|
|
httpPostLimit |
number |
Defines the number of locations maximal sent to the server at once. |
MAX_INTEGER |
httpPostFrequency |
number |
Defines the server upload frequency in milliseconds. |
10000 |
idleTimeUntilNotification |
number |
When the location has not changed during the given amount of milliseconds, the service returns a notification. The default time is 4620000 |
|
waitForClientCollection |
boolean |
Indicates, whether a location shall wait for the client to be collected, before it can be (regularly) cleared from the storage. |
|
backgroundService |
boolean |
Allows the service to persist in the background, although the main app itself might have been shut down already. |
false |
InfaBgLocCleanupSessionOptions
Prop |
Type |
Description |
Default |
sessionToken |
string |
The session to be cleaned up. (required) |
|
minSessionAge |
number |
Defines the minimum age of the session in days, before it can be discarded. A value of 0 allows the service to immediately delete the location. |
0 |
forceCleanup |
boolean |
All locations have to be posted to a server (through HTTP-POST) by the native upload client, before any location of the session will be deleted. |
true |
InfaBgLocCleanupByIdsOptions
Prop |
Type |
Description |
ids |
number[] |
The ids to be cleaned up. |
Prop |
Type |
remove |
() => Promise<void> |
'prompt' | 'prompt-with-rationale' | 'granted' | 'denied'
(err: any, ...args: any[]): void