I am building a navigation-based application for iOS 7 because I am taking user location data using the CoreLocation infrastructure,
The requirement for the application is to start receiving the location of users in the background at a certain time, for this I applied Silent Pushnotification using the method didReceiveRemoteNotification fetchCompletionHandler:,
I successfully implement using Silent Pushnotification and call startUpdatingLocation, and I can get location data in the delegate method:
Using this payload:
{"aps" : {"content-available" : 1},"SilentPush" : "4"}
I turned on locationand remote notificationfor the background mode:

- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult result))handler
{
__block UIBackgroundTaskIdentifier bgTask =0;
UIApplication *app = [UIApplication sharedApplication];
bgTask = [app beginBackgroundTaskWithExpirationHandler:^{
[self.locationManager startUpdatingLocation];
}];
didUpdateLocations
- (void)locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray *)locations
{
lastLoc=[locations lastObject];
[logFile addLocObject:[NSString stringWithFormat:@"Loc: %@",lastLoc]];
}
But the problem is this:
location , - , , , "didFinishLaunhing", , os , ,
Diagnostics & usage :
Application Specific Information:
MockUpApp2[390] has active assertions beyond permitted time:
{(
<BKProcessAssertion: 0x145ac790> identifier: Called by MockUpApp2, from -[AppDelegate application:didReceiveRemoteNotification:fetchCompletionHandler:] process: MockUpApp2[390] permittedBackgroundDuration: 40.000000 reason: finishTaskAfterBackgroundContentFetching owner pid:390 preventSuspend preventIdleSleep preventSuspendOnSleep
)}
, push-,
, , .
.
.. , , XCode , . .
1
@Stephen Darlington ,
,
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult result))handler
{
[self.locationManager startUpdatingLocation];
}
didUpdateLocations ,: (
?
Edit 2
Apple Doc :
If your app is suspended or not running, the system wakes up or launches your app and puts it into the background running state before calling the method.
SO, , ,?