KingOrmon Posted December 14, 2020 Share Posted December 14, 2020 Hi, I need to save geo location (latitude and longitud) using javascript using a timer with 1 min interval (saves the point each 1 min) Works but when mobile device is locked or enter in background mode geo location is stopped. Any ideas ? Link to comment Share on other sites More sharing options...
Mehmet Emin Posted December 14, 2020 Share Posted December 14, 2020 Service workers is the way to go.. Link to comment Share on other sites More sharing options...
KingOrmon Posted December 14, 2020 Author Share Posted December 14, 2020 But service workers requiere a native app on mobile ? Link to comment Share on other sites More sharing options...
Mehmet Emin Posted December 14, 2020 Share Posted December 14, 2020 1 minute ago, KingOrmon said: But service workers requiere a native app on mobile ? You can use service workers in JS. I have used them to send messages to my web app (when they are in the background) but not tried geo location. Link to comment Share on other sites More sharing options...
Mehmet Emin Posted December 14, 2020 Share Posted December 14, 2020 Sorry it seems that Geolocation object inside worker thread is not available. Link to comment Share on other sites More sharing options...
Mehmet Emin Posted December 14, 2020 Share Posted December 14, 2020 https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API On the above Service Worker API documentation there are mentions of geo-location or geo-fencing. with "In the future..." wish. Link to comment Share on other sites More sharing options...
Recommended Posts