title: Track user position when app is closed in Phonegap app
body: <p>In my Phonegap app, I want to implement a local notification similar to:</p>
  
  <p><a href="https://i.stack.imgur.com/uwvnb.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/uwvnb.jpg" alt="this one"></a> </p>
  
  <p>as done by Google Maps.</p>
  
  <p>In other words, the app should detect when the device is near a specific location and ask the user if he wants to check in.</p>
  
  <p>It must NOT be a service running when the app is in the background or killed, but it has to run when the app is completely closed (My background service is working). </p>
  
  <p>I suppose there is no way to get this done by using the traditional Phonegap JS plugins, how can this be achieved otherwise? I suppose it must be some kind of Java daemon running on the device? </p>
  
  <p>And is this kind of tracking even allowed in the Android and iOS TOS? </p>