Re: [slightlyoff/ServiceWorker] Additional PositionOptions required for ServiceWorker background GeoLocation (#898)

This following is just in from a very tasty start-up in France (What is wrong with you people refusing to  answer these requirements???): -

On Wed, May 25, 2016 at 10:29 AM, Ruben B <> wrote:
Hi,

Sorry for my english but i'm french. I'm founder of a meal delivery startup.

I recently read yours messages on Github about geolocation web worker issue So first congratulation for your fight in discuss, i loved yours posts.

I have exactly the same problem. I developed a web app for my delivery cyclists, this app permiss to manager orders and geolocate bikers to send position to a tracking web page for customers.
The app works so great, I' m really proud of me because i'm not a real developper but a coding passionate and exactly like you i'm very disappointed by fact of locking phone or just switching tab or minimizing browser will stop execution script and geolocation update obviously.

I saw in yours messages that firefox allow watchPosition() in background, but after research i saw that's only on firefox OS. So i don't know what i can do, i love use web app for many reasons, and i don't want create a native app only for that.

The only solution i found for moment it's to use noSleep.js, https://github.com/richtr/NoSleep.js , a kind of polyfill of firefoxOS function wakeLock(); 
But obviously this solution sucks because smarphone will be on untill all time of delivery and battery will be terribly decrease.

Did you find another solution ? 

Thanks in advance and if you want exchange about dev or business, i would be really happy.  :)
-- 
Ruben
Founder
eatforlife.fr

I am now convinced that, just like FIFA or the IOC, the level of corruption pervading the corridors of W3C and IETF can no longer be excused as ignorance. I am honestly of the opinion that the various HTTP protocol specification developers are on the take from Native App companies with the bribes aimed at ham-stringing Web App functionality. I simply cannot see any other explanation for it :-(

Can nobody else see the irony in Mozilla employees preventing this functionality whilst at the same time Firefox is the only browser that tracks you in the background? Try this and put FF in the background and/or turn off the phone: -

<!DOCTYPE html>
<html>
<body>

<p>Wait 5 secs.</p><br />

<p id="out"></p>

<script>

     function success(position){

  var x = document.getElementById("out");
  x.innerHTML += position.timestamp+" GPS "+Date() + "<br />";
      
  }

     function failure(error){
  var x = document.getElementById("out");
  x.innerHTML += error+" Error "+Date() + "<br />";
  }
  
 document.getElementById("out").innerHTML = "Start "+Date()+"<br />";
 
  if (document.addEventListener){
   document.addEventListener("visibilitychange", function() {
     var x = document.getElementById("out");   
     x.innerHTML +=  document.visibilityState +Date() + "<br />";
     })
  } else {
   document.attachEvent("onvisibilitychange", function() {
     var x = document.getElementById("out");   
     x.innerHTML +=  document.visibilityState +Date() + "<br />";
     })
  }

 
    setTimeout(function(){ 
     var x = document.getElementById("out");
     x.innerHTML += "Timeout "+Date() + "<br />";
     }, 5000);
     
 trackerId = navigator.geolocation.watchPosition(success, failure, {
    enableHighAccuracy: true
   });

</script>

</body>
</html>

---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/slightlyoff/ServiceWorker/issues/898#issuecomment-221480923

Received on Wednesday, 25 May 2016 06:02:19 UTC