0.0.16 • Published 5 months ago
elsapiens-background-location
Save background location in sql lite and make available to cpacitor subscription when app is active
Install
npm install elsapiens-background-location
npx cap sync
API
startTracking(...)
startTracking({ reference, highAccuracy, minDistance, interval }: { reference: string; highAccuracy: boolean; minDistance: number; interval: number; }) => Promise<void>
Param | Type |
---|
__0 | { reference: string; highAccuracy: boolean; minDistance: number; interval: number; } |
stopTracking()
stopTracking() => Promise<void>
getStoredLocations(...)
getStoredLocations({ reference }: { reference: string; }) => Promise<{ locations: LocationData[]; }>
Param | Type |
---|
__0 | { reference: string; } |
Returns: Promise<{ locations: LocationData[]; }>
clearStoredLocations()
clearStoredLocations() => Promise<void>
addListener('locationUpdate', ...)
addListener(eventName: 'locationUpdate', listenerFunc: (data: LocationData) => void) => Promise<PluginListenerHandle>
Param | Type |
---|
eventName | 'locationUpdate' |
listenerFunc | (data: LocationData) => void |
Returns: Promise<PluginListenerHandle>
addListener('locationStatus', ...)
addListener(eventName: 'locationStatus', listenerFunc: (status: { enabled: boolean; }) => void) => Promise<PluginListenerHandle>
Param | Type |
---|
eventName | 'locationStatus' |
listenerFunc | (status: { enabled: boolean; }) => void |
Returns: Promise<PluginListenerHandle>
getLastLocation(...)
getLastLocation({ reference }: { reference: string; }) => Promise<void>
Param | Type |
---|
__0 | { reference: string; } |
startLocationStatusTracking()
startLocationStatusTracking() => Promise<void>
stopLocationStatusTracking()
stopLocationStatusTracking() => Promise<void>
Interfaces
LocationData
Prop | Type |
---|
reference | string |
index | number |
latitude | number |
longitude | number |
altitude | number |
speed | number |
heading | number |
accuracy | number |
altitudeAccuracy | number |
totalDistance | number |
timestamp | number |
PluginListenerHandle
Prop | Type |
---|
remove | () => Promise<void> |