infa-bgloc
v1.3.69
Published
INFA-Background Geolocation
Downloads
15
Maintainers
Readme
bglocng17
Background geolocation tracker for internal purposes.
Install
npm install bglocng17
npx cap sync
API
echo(...)
checkPermissions()
requestPermissions()
start(...)
stop()
getLocations(...)
getStoredLocationsCount()
getAll()
confirmReception(...)
upload(...)
cleanup(...)
addListener(string, ...)
on(...)
- Interfaces
- Type Aliases
echo(...)
echo(options: { value: string; }) => Promise<{ value: string; }>
| Param | Type |
| ------------- | ------------------------------- |
| options
| { value: string; } |
Returns: Promise<{ value: string; }>
checkPermissions()
checkPermissions() => Promise<PermissionStatus>
Returns: Promise<PermissionStatus>
requestPermissions()
requestPermissions() => Promise<PermissionStatus>
Returns: Promise<PermissionStatus>
start(...)
start(config: InfaBgLocConfig) => Promise<void>
| Param | Type |
| ------------ | ----------------------------------------------------------- |
| config
| InfaBgLocConfig |
stop()
stop() => Promise<void>
getLocations(...)
getLocations(options: InfaBgLocFetchOptions) => Promise<InfaBgLocationArray>
| Param | Type |
| ------------- | ----------------------------------------------------------------------- |
| options
| InfaBgLocFetchOptions |
Returns: Promise<InfaBgLocationArray>
getStoredLocationsCount()
getStoredLocationsCount() => Promise<InfaBgLocationCount>
Returns: Promise<InfaBgLocationCount>
getAll()
getAll() => Promise<InfaBgLocationArray>
Returns: Promise<InfaBgLocationArray>
confirmReception(...)
confirmReception(options: InfaBgLocConfirmReceptionOptions) => Promise<void>
| Param | Type |
| ------------- | --------------------------------------------------------------------------------------------- |
| options
| InfaBgLocConfirmReceptionOptions |
upload(...)
upload(config: InfaBgLocSessionConfig) => Promise<void>
| Param | Type |
| ------------ | ------------------------------------------------------------------------- |
| config
| InfaBgLocSessionConfig |
cleanup(...)
cleanup(options?: InfaBgLocCleanupSessionOptions | InfaBgLocCleanupByIdsOptions | undefined) => Promise<void>
| Param | Type |
| ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| options
| InfaBgLocCleanupSessionOptions | InfaBgLocCleanupByIdsOptions |
addListener(string, ...)
addListener(eventName: string, listenerFunc: ListenerCallback) => Promise<PluginListenerHandle> & PluginListenerHandle
| Param | Type |
| ------------------ | ------------------------------------------------------------- |
| eventName
| string |
| listenerFunc
| ListenerCallback |
Returns: Promise<PluginListenerHandle> & PluginListenerHandle
on(...)
on(eventName: string) => Observable<any>
| Param | Type |
| --------------- | ------------------- |
| eventName
| string |
Returns: Observable<any>
Interfaces
PermissionStatus
| Prop | Type |
| -------------- | ----------------------------------------------------------- |
| location
| PermissionState |
InfaBgLocConfig
Used to configure the background service
InfaBgLocationArray
| Prop | Type |
| ----------- | ----------------------------- |
| items
| InfaBgLocation[] |
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 |
InfaBgLocFetchOptions
| 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 |
InfaBgLocationCount
| Prop | Type |
| ----------- | ------------------- |
| count
| number |
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. |
InfaBgLocSessionConfig
| 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. |
PluginListenerHandle
| Prop | Type |
| ------------ | ----------------------------------------- |
| remove
| () => Promise<void> |
Type Aliases
PermissionState
'prompt' | 'prompt-with-rationale' | 'granted' | 'denied'
ListenerCallback
(err: any, ...args: any[]): void