1.3.33 • Published 4 years ago

capacitor-background-location v1.3.33

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

capacitor-background-location

this plugins ensures to get the location in background when app is suspended

Install

npm install capacitor-background-location
npx cap sync

API

setConfig(...)

setConfig(config: IConfig) => Promise<{}>
ParamType
configIConfig

Returns: Promise<{}>


getGpsStatus()

getGpsStatus() => Promise<IGpsStatus>

Returns: Promise<IGpsStatus>


start(...)

start(options: IStartOptions) => Promise<{}>
ParamType
optionsIStartOptions

Returns: Promise<{}>


stop()

stop() => Promise<{}>

Returns: Promise<{}>


addListener(...)

addListener(eventName: EVENTS.Change, callback: (location: ILocation) => void) => Promise<PluginListenerHandle> & PluginListenerHandle
ParamType
eventNameEVENTS.Change
callback(location: ILocation) => void

Returns: Promise<PluginListenerHandle> & PluginListenerHandle


addListener(...)

addListener(eventName: EVENTS.Error, callback: (err?: any) => void) => Promise<PluginListenerHandle> & PluginListenerHandle
ParamType
eventNameEVENTS.Error
callback(err?: any) => void

Returns: Promise<PluginListenerHandle> & PluginListenerHandle


removeAllListeners()

removeAllListeners() => Promise<void>

Interfaces

IConfig

PropType
titlestring
descriptionstring
urlstring
headers{ key: string: string; }
body{ key: string: any; }

IGpsStatus

PropType
statusboolean

IStartOptions

PropType
intervalnumber
locationPriorityLOCATION_PRIORITY_ANDROID

PluginListenerHandle

PropType
remove() => Promise<void>

ILocation

PropType
latitudenumber
longitudenumber
accuracynumber
altitudenumber
bearingnumber
anglenumber
speednumber
timestring

Enums

LOCATION_PRIORITY_ANDROID

MembersValue
PRIORITY_HIGH_ACCURACY100
PRIORITY_BALANCED_POWER_ACCURACY102
PRIORITY_LOW_POWER104
PRIORITY_NO_POWER105

EVENTS

MembersValue
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