Re: [ServiceWorker] Expose GeoLocation to workers (#745)

@joemarini 
> Scenario: SW receives a push event, and my handler wants to check the current geolocation so I can warn the user about a potential nasty weather issue in their area.

Exactly Joe! But can I ask why you have devolved the "am I in danger" geofence logic to the client? Why send them a message if you know (or should know) that it does not concern them?

Weather is transitory and localized. If you follow my and @mkruisselbrink 's recommendations then the server will know exactly who is in/out of the danger zone and therefore needs to be PUSHed.

Please allow me to offer alternative requirements:- 

1) University security have just been told there's a shooter on campus. They touch the google maps screen and tell the system to warn everyone in a 2km radius to get out or get down. The geoFence has only just been created. Pushing the details to the client won't help you because Martin et al have ruled out creating geofences in the Service Worker and we don't know if we're in the foreground on the device.

2) The library is closing. The librarian sends a push message to anyone in the building (who hopefully have their notifications on vibrate :-)

3) The next 10 customers to the Guild Tavern get a free beer. No use having permanent geofences around every retail establishment that may want to communicate with customers.

This is SERVER driven logic not fat client bloatware.

---
Reply to this email directly or view it on GitHub:
https://github.com/slightlyoff/ServiceWorker/issues/745#issuecomment-183182121

Received on Friday, 12 February 2016 05:10:27 UTC