1.0.1 • Published 2 years ago

@deliverables/capacitor-location v1.0.1

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

Geolocation for web, android and ios.

React library for fetching location on web, android and ios using capacitor js.

NPM JavaScript Style Guide

Install

npm install --save @deliverables/capacitor-location

yarn add @deliverables/capacitor-location

Usage

import { useCapacitorLocation } from '@deliverables/capacitor-location'

const { coords, removeLocationWatcher, removeBackgroundLocationWatcher } =
  useCapacitorLocation({
    watchForBackgroundLocation: true,
    onBackgroundLocationChange: (location) => {
      console.log('Background location changed', location)
    },
    onError: (error) => {
      alert('Error: ' + error.message)
    },
    onBackgroundLocationError(error) {
      alert('Background location error: ' + error.message)
    }
  })

License

MIT © hitesh-webRepo