View Full Version : How to make GPS daemon

Dec 16, 2008, 01:27 PM
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

Jan 13, 2009, 11:36 PM
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?

Jan 13, 2009, 11:49 PM
PS this app is not for appStore, it is for jailBroken devices
I doubt you'll get much help on these forums with non-Apple-SDK development for jail-broken devices.