1.3.33 • Published 4 years ago
capacitor-background-location v1.3.33
capacitor-background-location
this plugins ensures to get the location in background when app is suspended
Install
npm install capacitor-background-location
npx cap syncAPI
setConfig(...)getGpsStatus()start(...)stop()addListener(...)addListener(...)removeAllListeners()- Interfaces
- Enums
setConfig(...)
setConfig(config: IConfig) => Promise<{}>| Param | Type |
|---|---|
config | IConfig |
Returns: Promise<{}>
getGpsStatus()
getGpsStatus() => Promise<IGpsStatus>Returns: Promise<IGpsStatus>
start(...)
start(options: IStartOptions) => Promise<{}>| Param | Type |
|---|---|
options | IStartOptions |
Returns: Promise<{}>
stop()
stop() => Promise<{}>Returns: Promise<{}>
addListener(...)
addListener(eventName: EVENTS.Change, callback: (location: ILocation) => void) => Promise<PluginListenerHandle> & PluginListenerHandle| Param | Type |
|---|---|
eventName | EVENTS.Change |
callback | (location: ILocation) => void |
Returns: Promise<PluginListenerHandle> & PluginListenerHandle
addListener(...)
addListener(eventName: EVENTS.Error, callback: (err?: any) => void) => Promise<PluginListenerHandle> & PluginListenerHandle| Param | Type |
|---|---|
eventName | EVENTS.Error |
callback | (err?: any) => void |
Returns: Promise<PluginListenerHandle> & PluginListenerHandle
removeAllListeners()
removeAllListeners() => Promise<void>Interfaces
IConfig
| Prop | Type |
|---|---|
title | string |
description | string |
url | string |
headers | { key: string: string; } |
body | { key: string: any; } |
IGpsStatus
| Prop | Type |
|---|---|
status | boolean |
IStartOptions
| Prop | Type |
|---|---|
interval | number |
locationPriority | LOCATION_PRIORITY_ANDROID |
PluginListenerHandle
| Prop | Type |
|---|---|
remove | () => Promise<void> |
ILocation
| Prop | Type |
|---|---|
latitude | number |
longitude | number |
accuracy | number |
altitude | number |
bearing | number |
angle | number |
speed | number |
time | string |
Enums
LOCATION_PRIORITY_ANDROID
| Members | Value |
|---|---|
PRIORITY_HIGH_ACCURACY | 100 |
PRIORITY_BALANCED_POWER_ACCURACY | 102 |
PRIORITY_LOW_POWER | 104 |
PRIORITY_NO_POWER | 105 |
EVENTS
| Members | Value |
|---|---|
Change | "CHANGE" |
Error | "ERROR" |
ANDROID
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />And add xmlns:tools="http://schemas.android.com/tools" to AndroidManifest.xml
<key>NSLocationAlwaysUsageDescription</key>
<string>Description</string>
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
<string>Description</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string>Description</string>And enable to Location update from Signing & Capabilities in xcode
1.3.33
4 years ago
1.3.25
4 years ago
1.3.21
4 years ago
1.3.15
4 years ago
1.3.11
4 years ago
1.3.0
4 years ago
1.1.55
4 years ago
1.1.35
4 years ago
1.1.33
4 years ago
1.1.1
4 years ago
1.0.35
4 years ago
1.0.1
4 years ago
0.1.91
4 years ago
0.1.75
4 years ago
0.0.91
4 years ago
0.0.77
4 years ago
0.0.71
4 years ago
0.0.69
4 years ago
0.0.67
4 years ago
0.0.15
4 years ago
0.0.11
4 years ago
0.0.9
4 years ago
0.0.7
4 years ago
0.0.5
4 years ago
0.1.1
5 years ago
0.1.0
5 years ago