-
Notifications
You must be signed in to change notification settings - Fork 4
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
Add a manifest and service worker and all that junk #1
Comments
Good call. If I can't find any e-bikes, might work on adding that this weekend. |
Does anyone know if adding it to the home screen means that it can run in the background, so your phone could be in your pocket with the screen off, but still notify you when there's a bike nearby? I've been working on a much less polished version of this project at https://reported-web.herokuapp.com/electricitibikes (code at https://github.com/josephfrazier/Reported-Web/blob/51f31cae45f5f554252a102a50744d36e8879c33/src/routes/electricitibikes/ElectriCitibikes.js), and getting it to work without being in the foreground was a goal of mine, but I don't know how easy that is. EDIT: Getting the current position might also not be possible, which could pose a problem for the use case of: I'm riding a manual citibike, but would like to switch to an electric one if possible w3c/ServiceWorker#745 |
Background notifications are somewhat involved — basically there needs to be a server that maintains a list of clients (service workers) and can send notifications to them, and the service worker needs to have some code like self.addEventListener('push', event => {
// some magic happens
}); There's a guide here — the length of it tells you how much of a nuisance it is to set up. It's definitely doable, it's just a lot more work than foreground notifications. |
Thanks for the info! That's what I was suspecting, that it couldn't be completely client-side anymore, but I was still a bit unsure. Maybe I'll get around to it someday... :P |
Unless the service worker was responsible for polling the stations you've marked, perhaps... I don't know if that's possible but it might be. Hmm, now I want to investigate 🤔 |
Yeah, I'm currently using Server-sent events, but I don't know if those keep going to a backgrounded PWA. |
ServiceWorkers need to simply implement the TravelManager detailed here |
...so that we Android users can add it to the home screen
The text was updated successfully, but these errors were encountered: