capacitor-foreground-location-service
v0.2.12
Published
A capacitor plugin for foreground location service in android and iOs
Maintainers
Readme
capacitor-foreground-location-service
A capacitor plugin for foreground location service in android and iOs
Install
npm install capacitor-foreground-location-service
npx cap syncAPI
setApiOptions(...)config(...)requestPermission()startService()stopService()addListener('locationUpdate', ...)isLocationServiceRunning()getStoredValue()getApiOptions()initialize(...)startUpdatingLocation()stopUpdatingLocation()appIsInBackground()showLocalNotification(...)setClockHistory(...)hasClockedIn(...)hasClockedOut(...)saveAutoClockData(...)getAutoClockData()eraseAutoClockingData()- Interfaces
- Type Aliases
setApiOptions(...)
setApiOptions(apiOptions: CompleteOrNothing<SetApiOptions>) => Promise<OptionResponse>| Param | Type |
| ---------------- | ----------------------------------------------------------------------------------------------------------------- |
| apiOptions | CompleteOrNothing<SetApiOptions> |
Returns: Promise<OptionResponse>
config(...)
config(config: ForegroundLocationConfiguration) => Promise<void>| Param | Type |
| ------------ | ------------------------------------------------------------------------------------------- |
| config | ForegroundLocationConfiguration |
requestPermission()
requestPermission() => Promise<PermissionResponse>Returns: Promise<PermissionResponse>
startService()
startService() => Promise<void>stopService()
stopService() => Promise<void>addListener('locationUpdate', ...)
addListener(eventName: 'locationUpdate', listenerFunc: (location: ForegroundLocation) => void) => Promise<PluginListenerHandle> & PluginListenerHandle| Param | Type |
| ------------------ | ---------------------------------------------------------------------------------------- |
| eventName | 'locationUpdate' |
| listenerFunc | (location: ForegroundLocation) => void |
Returns: Promise<PluginListenerHandle> & PluginListenerHandle
isLocationServiceRunning()
isLocationServiceRunning() => Promise<ServiceRunningResponse>Returns: Promise<ServiceRunningResponse>
getStoredValue()
getStoredValue() => Promise<CompleteOrNothing<SetApiOptions>>Returns: Promise<CompleteOrNothing<SetApiOptions>>
getApiOptions()
getApiOptions() => Promise<ForegroundLocationConfiguration>Returns: Promise<ForegroundLocationConfiguration>
initialize(...)
initialize(config: ForegroundLocationConfigurationIOS) => Promise<void>| Param | Type |
| ------------ | ------------------------------------------------------------------------------------------------- |
| config | ForegroundLocationConfigurationIOS |
startUpdatingLocation()
startUpdatingLocation() => Promise<void>stopUpdatingLocation()
stopUpdatingLocation() => Promise<void>appIsInBackground()
appIsInBackground() => Promise<BackgroundNotification>Returns: Promise<BackgroundNotification>
showLocalNotification(...)
showLocalNotification(options: NotificationOptionsiOs) => Promise<void>| Param | Type |
| ------------- | ------------------------------------------------------------------------- |
| options | NotificationOptionsiOs |
setClockHistory(...)
setClockHistory(clockHistory: SetClockHistoryPayload) => Promise<SetClockHistoryResponse>| Param | Type |
| ------------------ | ------------------------------------------------------------------------- |
| clockHistory | SetClockHistoryPayload |
Returns: Promise<SetClockHistoryResponse>
hasClockedIn(...)
hasClockedIn(payload: FSClockParam) => Promise<ClockHistory>| Param | Type |
| ------------- | ----------------------------------------------------- |
| payload | FSClockParam |
Returns: Promise<ClockHistory>
hasClockedOut(...)
hasClockedOut(payload: FSClockParam) => Promise<ClockHistory>| Param | Type |
| ------------- | ----------------------------------------------------- |
| payload | FSClockParam |
Returns: Promise<ClockHistory>
saveAutoClockData(...)
saveAutoClockData(clockData: ClockingDataParameter) => Promise<ClockingDataResponse>| Param | Type |
| --------------- | ----------------------------------------------------------------------- |
| clockData | ClockingDataParameter |
Returns: Promise<ClockingDataResponse>
getAutoClockData()
getAutoClockData() => Promise<GetClockingDataResponse>Returns: Promise<GetClockingDataResponse>
eraseAutoClockingData()
eraseAutoClockingData() => Promise<ClockingDataResponse>Returns: Promise<ClockingDataResponse>
Interfaces
OptionResponse
| Prop | Type |
| ------------ | ------------------- |
| result | string |
SetApiOptions
| Prop | Type |
| ----------------------- | ------------------------------------------------------------------- |
| endpoint | Endpoint |
| geofenceData | GeofenceData |
| userData | UserData |
| logsEndpoint | LogsEndpoint |
| allowNotification | NotificationEnabled |
Endpoint
| Prop | Type |
| -------------- | ------------------- |
| endPoint | string |
GeofenceData
| Prop | Type |
| ------------------ | ----------------------- |
| geofenceData | Geofence[] |
Geofence
| Prop | Type |
| ------------------------- | ------------------- |
| clockNumber | number |
| clockDescription | string |
| locationCode | string |
| locationDescription | string |
| lat | number |
| lng | number |
| radius | number |
UserData
| Prop | Type |
| -------------- | ------------------- |
| username | string |
| userId | number |
| _token | string |
LogsEndpoint
| Prop | Type |
| ------------------ | ------------------- |
| logsEndpoint | string |
NotificationEnabled
| Prop | Type |
| ----------------------- | -------------------- |
| allowNotification | boolean |
ForegroundLocationConfiguration
| Prop | Type |
| ---------------------------- | ------------------- |
| interval | number |
| distanceFilter | number |
| notificationTitle | string |
| notificationMessage | string |
| notificationImportance | number |
| notificationChannelId | number |
PermissionResponse
| Prop | Type |
| ------------- | -------------------- |
| granted | boolean |
PluginListenerHandle
| Prop | Type |
| ------------ | ----------------------------------------- |
| remove | () => Promise<void> |
ForegroundLocation
| Prop | Type |
| -------------- | ------------------- |
| lat | number |
| lng | number |
| altitude | number |
| accuracy | number |
| speed | number |
| bearing | number |
| time | number |
ServiceRunningResponse
| Prop | Type |
| ------------- | -------------------- |
| running | boolean |
ForegroundLocationConfigurationIOS
| Prop | Type |
| -------------------- | ----------------------------------------------------------------- |
| accuracy | 'high' | 'low' |
| distanceFilter | number |
| updateInterval | number |
| batteryMode | 'default' | 'fitness' | 'navigation' | 'lowPower' |
BackgroundNotification
| Prop | Type |
| ------------------ | -------------------- |
| isBackground | boolean |
NotificationOptionsiOs
| Prop | Type |
| ----------- | ------------------- |
| title | string |
| body | string |
SetClockHistoryResponse
| Prop | Type |
| ------------ | ------------------- |
| status | string |
SetClockHistoryPayload
| Prop | Type |
| ------------------ | -------------------------- |
| clockNumber | number |
| clockingType | 'in' | 'out' |
| timestamp | number |
ClockHistory
| Prop | Type |
| ------------ | -------------------- |
| result | boolean |
FSClockParam
| Prop | Type |
| ----------------- | ------------------- |
| clockNumber | number |
| timeStamp | number |
ClockingDataResponse
| Prop | Type |
| ------------ | ------------------- |
| status | string |
ClockingDataParameter
| Prop | Type |
| -------------------- | ----------------------------------------------------------------------- |
| failedEndpoint | string |
| payload | FSAutoClockingPayload |
| errorMessage | string |
| token | string |
FSAutoClockingPayload
| Prop | Type |
| --------------- | --------------------------------------------------------------------------------------- |
| empId | string |
| lat | number |
| lng | number |
| isInside | boolean |
| geofence | FSGeofenceInformationDistance |
| timeStamp | number |
FSGeofenceInformationDistance
| Prop | Type |
| ------------------------- | ------------------- |
| lat | number |
| lng | number |
| radius | number |
| clockDescription | string |
| clockNumber | number |
| locationCode | string |
| locationDescription | string |
GetClockingDataResponse
| Prop | Type |
| ---------- | -------------------------------------------- |
| logs | ClockingDataParameter[] | null |
Type Aliases
CompleteOrNothing
T |
