title: Swift - Find other users running app nearby
body: <p>Need some help with logic. I am storing my app user's location information (lat,long) in a database on app launch (and periodically update while app is in use).</p>
  
  <p>A main function of my app will be to find users nearby that are also currently running the app. </p>
  
  <p>It is not sufficient to just query the database for "nearby users" within a proximity range because I need them to also be running the app.</p>
  
  <p>I'm not sure how to "know" when a user has the app running versus one that used my app 5 minutes ago (logged its lat/lng) and then closed the app.</p>
  
  <p>Seen similar questions (android specific), but none really touch on "active" users.</p>
  
  <p>(Currently coded in Swift with PHP as my server side language)</p>