Comments (1)
For users using a web browser on the same device consider using a SharedWorker
incase the user had multiple browser windows open https://developer.mozilla.org/en-US/docs/Web/API/SharedWorker rather than just a standard web workerWorker
?
But since the user might be accessing the app on multiple devices at the same time (web browser X on device A, web browser Y on device A, android app on device B), i think we'd need to setup a server, where each frontend checks the device location using HTML5 Geolocation API and sends it to the server which is where we'd update the latest location and check if their location and that of other relevant users has changed.
I'm not sure how to handle if a different location is sent from different devices that they're logged in to, maybe in settings they configure which device(s) they want use to share their location, and we'd otherwise have to detect which device is most likely active by prioritising the device where latest UI interaction has occurred, and we'd store that server-side.
On the server-side we'd allow sufficient time using setInterval
for each of the possible devices that they've registered that they could be using to have shared their latest location from) and after that interval we'd respond as to whether their location has changed or if any of their contacts is nearby, by emitting the data broadcasting it to each client over a websockets, and that'd be received by a websockets connection on each client. i'm not sure whether we'd use 'polling' or 'websockets' for the transport (i.e. http://localhost:3000/socket.io/?EIO=4&transport=polling) https://socket.io/docs/v3/client-initialization/.
Then we'd integrate data received on the client-side via websockets with the client-side web workers (i.e. SharedWorker
) like shown here https://developer.mozilla.org/en-US/docs/Web/API/SharedWorker for web browser implementations
I also think we'd need to setup a server since it might reduce the risk of exposing their location and where their data is being stored.
from lets-stay-in-touch.
Related Issues (15)
- Can it be a basic web app or does it need to be a native app? HOT 2
- Basic app structure HOT 1
- Contacts list HOT 1
- Add contact in app v1 HOT 2
- Basic contact store v1 HOT 1
- remote storage v1 HOT 1
- basic crypto HOT 1
- remote sync controller HOT 2
- Settings panel
- Update page v1 HOT 1
- Update page v2
- Contact details v1 HOT 1
- Contact details v2
- Switch to modern syntax for Ionic labels and inputs
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lets-stay-in-touch.