Skip to content

ankurmalik491/react-native-foreground-location-service-ankur

Repository files navigation

react-native-ankur-forground-service-location

Getting started

$ npm install react-native-foreground-location-service-ankur --save

Mostly automatic installation

$ react-native link react-native-foreground-location-service-ankur

Usage

import {
  DeviceEventEmitter,
} from 'react-native';
import AnkurForgroundServiceLocation from 'react-native-foreground-location-service-ankur';

// TODO: What to do with the module?
const EventEmitter = Platform.select({
  android: () => DeviceEventEmitter,
})();


EventEmitter.addListener('locationFetchingBackground', (location) => {
    // this will be executed once after 5 seconds
    console.log('location recevied',location);
  });


const notificationConfig ={
    title:"Fetching your location",
    icon:"ic_notification",
    color:"#0000ff"
  }
   // start Service
  AnkurForgroundServiceLocation.open(notificationConfig);

  //stop service
  AnkurForgroundServiceLocation.close();

About

React Native Foreground Service Location created by ankur on 20 march 2020 for fetching location in background.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published