How to make GPS daemon

Discussion in 'iOS Programming' started by HARDWARRIOR, Dec 16, 2008.

  1. HARDWARRIOR macrumors member

    Nov 17, 2008
    I want to make non-GUI application that in background collects gps location every 5 mins.

    I know how to make non-GUI app: just remove UIApplicationMain from main.m of ViewBased template an insert my code there. Such a app I can make to load at boot by creating a plist file in /System/Library/LaunchDaemons/
    But CLLocationManager can not call CLLocationManagerDelegate's selectors without UIApplicaiton (see attached screenshot of call stack)

    So how can I make desired app? May be there is a way to collect gps data without CLLocationManager e.g. just by calling some func. Or is there a way to replace UIApplicaiton with non-UI message runloop?

    PS this app is not for appStore, it is for jailBroken devices

    Attached Files:

  2. indiekiduk macrumors 6502

    Jul 26, 2005
    Glasgow, Scotland
    It works if you use a CFRunLoop in your application. What is very weird is it works in a command line app but not in a daemon. The error is:

    CLClientHandleDaemonDataRegistration: server did not accept client registration 2

    Why would that be?
  3. dejo Moderator


    Staff Member

    Sep 2, 2004
    The Centennial State
    I doubt you'll get much help on these forums with non-Apple-SDK development for jail-broken devices.

Share This Page