Quantcast
Channel: Active questions tagged react-native+ios - Stack Overflow
Viewing all articles
Browse latest Browse all 16750

React native Background geolocation updates IOS

$
0
0

This package

I need solution for i want to update location every 30 seconds.

I'm using this package for background geolocation updates when its working fine, but when i move my phone (iphone6) it send my location to firebase. I'm using location changes of this package because postTemplate is not working on IOS device and stoOnStillActivity:true for if activity is still it wont send location.

 BackgroundGeolocation.configure({        locationProvider: BackgroundGeolocation.ACTIVITY_PROVIDER,        desiredAccuracy: BackgroundGeolocation.MEDIUM_ACCURACY,        stationaryRadius: 10,        distanceFilter: 10,        debug: true,        interval: 30000,        stopOnStillActivity: true,  })

This one sending location to firebase

 BackgroundGeolocation.on('location', (location) => {        BackgroundGeolocation.startTask(taskKey => {            firestore()                .collection('testlocation')                .add({                    name: 'DEVICE',                    lat: location.latitude,                    lon: location.longitude,                    dat: new Date,                })                .then(() => {                    console.log('Location added BITCH!')                }).catch(e => console.log(e))            console.log("Stark task started successfully", new Date, location.latitude, location.longitude)            BackgroundGeolocation.endTask(taskKey)        })    })

Viewing all articles
Browse latest Browse all 16750

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>