Tracking App

Discussion in 'iOS Programming' started by oo7ml, Jul 7, 2014.

  1. oo7ml macrumors 6502

    Joined:
    Jan 20, 2010
    #1
    Hi,

    I've seen several tracking type apps whereby users can track their friends, and other apps that track the route that you run on Google Maps.

    I want to add a small feature to one of my apps so that your friends can send you a tracker invite, and then you can see your friend on Google Maps until they cancel the tracking.

    What would be the architecture behind building / designing this function. Should we just update the DB every 5 seconds with your friend's current location, and then keep refreshing your map so that you can see their new position every 5 seconds, or is there a better way to achieve this.

    Thanks in advance for your help.
     
  2. DannyBres macrumors 65816

    DannyBres

    Joined:
    Oct 30, 2007
    Location:
    UK
    #2
    Assuming you want this to scale: if every client reports location change every 5 seconds and polls for other location change every fovr seconds you are going to need a lot of server side infastructure with a lot of horsepower, if you get alot of users.

    This sounds like a terrible idea. You want the clients to only report back to the server when a certain distance thresehold has been reached, then trigger some kind of push of new data to the other clients following them.

    This sounds like very trick problem needing alot of clever server side code to be scalable.

    If you have <20 users, just do as you suggested and your be fine! :)

    Try reading Brent Simmon's blog at inessential.com
     
  3. AxoNeuron, Jul 22, 2014
    Last edited: Jul 22, 2014

    AxoNeuron macrumors 65816

    AxoNeuron

    Joined:
    Apr 22, 2012
    Location:
    The Left Coast
    #3
    If I'm not mistaken, I'd read up on Location Services. Most people's iPhones already gather location updates on a regular basis. The only thing you would need to do would be to send this data out in the background to your server, so that it can be sent to their authorized friends in a secure manor.

    This document is what you need: https://developer.apple.com/library...ionAwarenessPG/CoreLocation/CoreLocation.html

    Even when your app is running in the background it can deliver periodic updates. I would make it so that your app only provides background location updates for a 45 minute window after it has been requested. Also, ios has varying levels of accuracy, and the least accurate location updates require the least power. I would make it so that fine-grained high-accuracy tracking is only enabled with the friend who requested their location actually zooms in to them on a map. This would conserve battery life. iOS 8 monitors battery usage, and since gathering and sending location data constantly will use enormous battery life, your app will be the first to get uninstalled when people check battery usage per-app in iOS 8.
     

Share This Page