1

I am developing an application in which i am using location service.

Basically that app show that if u get any missed call at which place.

For this i have use core-location and core telephony frame works. But when i am testing app then location service not working in background. I have use this code for didfinishlaunching.

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

    UILocalNotification *localNotif = [launchOptions objectForKey:UIApplicationLaunchOptionsLocalNotificationKey]; 

    if (localNotif)
        application.applicationIconBadgeNumber = localNotif.applicationIconBadgeNumber-1; 
    locationManager = [[CLLocationManager alloc] init];
    locationManager.delegate = self;
    locationManager.distanceFilter = kCLDistanceFilterNone; // whenever we move
    locationManager.desiredAccuracy = kCLLocationAccuracyHundredMeters; // 100 m
    [locationManager startUpdatingLocation];
    [self callinbackground];

    [self.window makeKeyAndVisible];
    return YES;
}

and app goes in background then i have write down code form this link:- code

But when app goes in background then not working. How i fixed it?

Thanks in advance...

Matt S.
  • 13,305
  • 15
  • 73
  • 129
ios
  • 552
  • 5
  • 22
  • If you are trying to get location update on background for iOS 7, you may try this solution here: http://stackoverflow.com/questions/18946881/background-location-services-not-working-in-ios-7/21966662#21966662 If you have any question, you are welcomed to join us for a discussion here: http://mobileoop.com/background-location-update-programming-for-ios-7 – Ricky May 01 '14 at 15:23

1 Answers1

2

try this:- add key in info.plist

key>UIBackgroundModes</key>
    <array>
        <string>location</string>
    </array>
Deepesh
  • 8,065
  • 3
  • 28
  • 45