apache / apache/cordova-plugin-geolocation

Emit position event only by the time that a distance change was made - not automatically after 5 seconds

Open
#162 5 comments 0 reactions 0 assignees View on GitHub
enhancement platform: ios
Dominant language
JavaScript
Stars
646
Forks
654
PR merge metrics
No merged PRs in 30d

Description

# Feature Request

## Motivation Behind Feature
This is a must have feature. Save battery consuming, report about position changes to API only when there a significant change - instead of every 5 seconds.

## Feature Description
The watchPosition method emits the success callback after every 5 seconds (if there no errors). This is bad. It has to emit the event only when the user actually moves - in order to save battery and report to remote APIs only when needed.

## Alternatives or Workarounds
I am using some wrapper of the service, only when there some significant distance between previous position that was saved I send it to the DB.
I defined by my own the minimal distance in meters in order to consider a change.
This is not a good way of working. This plugin should emit only when there was a change in position and it should be setted for what is change in position or not.

Contributor guide

Open the contributing guide

Research direction

Start at the watchPosition entry point and trace how the JavaScript API reaches the Android and iOS implementations. Clarify the distance threshold and configuration behavior before determining the platform changes; done means callbacks are not emitted on a fixed five-second cadence and the requested distance rule is honored consistently.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, javascript, objective-c
Domain
mobile-dev
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.