1.0.1 • Published 3 years ago
@deliverables/capacitor-location v1.0.1
Geolocation for web, android and ios.
React library for fetching location on web, android and ios using capacitor js.
Install
npm install --save @deliverables/capacitor-location
yarn add @deliverables/capacitor-locationUsage
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