1

Hello everyone I am trying to get a location update when my app is in background. But the code below does not seems to work. The IF statement is never true. I have also set the necessary keys in the info.plist files. I am running the code in iphone 3GS and ipad 3.

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {    

    // Override point for customizatio-n after application launch.
    id locationValue = [launchOptions objectForKey:UIApplicationLaunchOptionsLocationKey];
    if (locationValue)
    {
        // create a new manager and start checking for sig changes

        locManager = [[CLLocationManager alloc] init];

        locManager.delegate = self;

        [locManager startMonitoringSignificantLocationChanges];

        return YES;
    }
  • Refer this link http://stackoverflow.com/questions/13396630/xcode-why-launchoptions-in-didfinishlaunchingwithoptions-always-nil and http://stackoverflow.com/questions/8725625/simulate-launch-options – Venk May 17 '13 at 11:49
  • UIApplicationLaunchOptionsLocationKey is only true if your application is launched due to location. I will never be true if u start by taping app icon or run from xcode. – CRDave May 17 '13 at 11:52

0 Answers0