Closed scottwilson312 closed 5 years ago
I expect that when distanceFilter is set to 0, that location services would remain off while is_moving is true,
This assumption is incorrect. When the activity-recognition system detects the device is moving, naturally location-services are on.
When activity-recognition system says device is still, stopTimeout is engaged and location-services toggle off after elapsed.
Thank you for the very fast response. I want to reiterate that this is a great plugin and I've been playing around with it for the past day - the documentation is outstanding.
Is there a need for location-services to be on if you are deciding if a user is moving solely on the ActivityRecognition api and are only grabbing a location based on the assumption that a user is moving and a periodic timer?
distanceFilter and locationUpdateInterval are merely 2 different ways to throttle locations coming off the radio stream and into the app: distance-based vs time-based.
To use time-based throttling (i.e. locationUpdateInterval), you set distanceFilter: 0.
Could you please re-phrase this. I don't understand your question.
Is there a need for location-services to be on if you are deciding if a user is moving solely on the ActivityRecognition api and are only grabbing a location based on the assumption that a user is moving and a periodic timer?
Let me know if I have incorrect understanding of some terms.
Locations-services on means that the app is actively using the GPS and consuming power.
Whether or not a user is_moving is based on the ActivityReocognition api which does not use the GPS.
While is_moving is true, location-services is constantly on (can see the little map marker icon int he status bar).
If we only want a location to be taken every 3 minutes while a user is moving, wouldn't we only want location-services to be turned on every 3 minutes, grab the location, then turn location-services back off for another 2 minutes 59 seconds?
Locations-services on means that the app is actively using the GPS and consuming power.
Yes
Whether or not a user is_moving is based on the ActivityReocognition api which does not use the GPS.
Correct. Activity Recognition API aggregates accelerometer & gyroscope. Low power; no radios involved.
While is_moving is true, location-services is constantly on (can see the little map marker icon int he status bar).
Correct
If we only want a location to be taken every 3 minutes while a user is moving, wouldn't we only want location-services to be turned on every 3 minutes, grab the location, then turn location-services back off for another 2 minutes 59 seconds?
There is no such mechanism. If you want something like this, it can probably implemented. It might take 5 hours @ $200 / hour.
Thank you for all the help, Chris. I may contact you in the future.
@christocracy As a paying customer - will the feature for timed/fixed location updates while moving be added to the paid version of the plugin?
@cfroerup I have no plans to implement anything in this thread.
Your Environment
react-native -v
): 0.42Plugin config
Expected Behavior
I expect that when distanceFilter is set to 0, that location services would remain off while is_moving is true, except for when the location is grabbed every locationUpdateInterval
Actual Behavior
Location services stays on any time is_moving is true and consumes battery.
Steps to Reproduce
Context
I am trying to get a users location whenever they change location and periodically when they are in transit, with absolute minimal battery drain. Ideally I would like to only use the GPS and have location services on in 2 situations:
(1) the user has gone from is_moving to still and is in a new location (2) periodically while they are moving
Thanks!