@coreo/ionic-background-tracking
Ionic 2+ module for tracking a users location
Last updated 2 years ago by joewoodhouse .
MIT · Repository · Original npm · Tarball · package.json
$ cnpm install @coreo/ionic-background-tracking 
SYNC missed versions from official npm registry.

@coreo/ionic-background-tracking

Ionic 2+ module for tracking a users location.

Installation

cordova plugin add https://github.com/transistorsoft/cordova-background-geolocation.git#2.11.0 --save
yarn add @coreo/ionic-background-tracking

Usage

Import the module in your app.module.ts;

import { CoreoBackgroundTrackingModule } from '@coreo/ionic-background-tracking';
...
@NgModule({
  imports: [
    ...
    CoreoBackgroundTrackingModule
    ...
  ]
})
export class AppModule {}

CoreoBackgroundTracking service

Inject the service into your component;

import { CoreoBackgroundTracking } from '@coreo/ionic-background-tracking';

@Component()
export class MyComponent() {
  constructor(private geoService: CoreoBackgroundTracking) {}
}

Methods

  • startTracking() - Enables location tracking. Returns an observable which emits the position of the device. Emitted position objects conform to the CoreoBackgroundTrackingPosition interface.
  • stopTracking() - Disables location tracking.
  • getCurrentLocation - Retrieves the current position of the device using maximum power and accuracy. Returns a promise which is resolved with an object conforming to the CoreoBackgroundTrackingPosition interface.
  • setConfig(config: ConfigurationOptions) - Sets the config to be used by the cordova-background-geolocation plugin. See the cordova-background-geolocation API documentation for a list of config options that can be set.
  • setCurrentPositionOptions(opts: CurrentPositionOptions) - Sets the options to be used by getCurrentPosition() function included in the cordova-background-geolocation plugin. See the cordova-background-geolocation API documentation for a list of options that can be set.

Properties

  • isTracking: boolean - Flag indicating whether location tracking is currently enabled.

Interfaces

  • CoreoBackgroundTrackingPosition
  • CurrentPositionOptions
  • ConfigurationOptions

Current Tags

  • 0.0.5                                ...           latest (2 years ago)

3 Versions

  • 0.0.5                                ...           2 years ago
  • 0.0.4                                ...           2 years ago
  • 0.0.3                                ...           2 years ago
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |