react-native-foreground-location-service-ankur
v1.0.1
Published
React Native Foreground Service Location created by ankur on 20 march 2020 for fetching location in background.
Downloads
2
Maintainers
Keywords
Readme
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();