1
我正在開發一個應用程序,我正在使用位置服務。基於位置的應用程序不能在後臺工作iPhone
基本上,該應用程序顯示,如果你得到任何地方的任何未接來電。
爲此,我使用核心位置和核心電話框架作品。但是,當我測試應用程序,然後位置服務不在後臺工作。 我已經使用此代碼進行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;
}
和應用進入後臺,我已記下代碼形式此鏈接: - code
但是,當應用程序在雲後臺,然後不工作。我如何修復它?
在此先感謝...
添加關鍵如果你想獲得位置更新的背景爲iOS 7,你可能會在這裏嘗試這種解決方案:http://stackoverflow.com/questions/18946881/background-location-services-not-working-in-ios-7/21966662#21966662如果您有任何問題,歡迎您加入我們的討論:http ://mobileoop.com/background-location-update-programming-for-ios-7 – Ricky 2014-05-01 15:23:05