Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use low-accuracy location sharing mode when nobody is looking on a map #154

Open
maximbaz opened this issue Sep 20, 2020 · 1 comment
Open
Labels
enhancement New feature or request

Comments

@maximbaz
Copy link
Contributor

It is a waste of battery to keep reporting device location in high-accuracy mode if nobody is looking on a map anyway.

I suggest that when nobody is looking on a map, detect location in low-accuracy mode, and only switch to high-accuracy mode while someone is looking at the map.

Here's how I would probably suggest to implement this:

  • The browser (that contains map component) should send to the server a message "I am looking at the map" every 15 seconds.
  • A server receives such a message and sends it to every device within the group (maybe debounced, i.e. not more often than every 15 seconds).
  • A phone by default uses low-accuracy mode, but if it receives a message from server, it switches to high-accuracy mode for the next 1 minute. If it receives the message while it is already in high-accuracy mode, it just extends the timeout to a full 1 minute.
@bilde2910
Copy link
Owner

This is a good suggestion, and could also be paired with showing the number of current viewers in-app. Whenever the app sends a location update to the server, the number of current viewers could be returned as part of the response from the server. The client can then decide if it wants to switch to low-accuracy mode if there are no current viewers. I will probably consider adding this once I switch over to v2.0 of Hauk, as this requires a change to the Hauk network protocol, and I have several updates to the protocol lined up already that increase the complexity of the protocol too much for it to be feasible to maintain on the v1.x protocol spec.

@bilde2910 bilde2910 added the enhancement New feature or request label Nov 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants