문제

I am developing a iOS Newsstand App. I use the background download feature. Everything except the following works fine:

If the App is in the background (started and then home button clicked) and it receives a remote push notification the method [UIApplicationDelegate didReceiveRemoteNotification] is called as expected. Then I do some calculations to get all the download URL's. The first time the push is received this works fine. During the handling of the following pushes the called syncData Method is aborted.

The whole computation can take up to 10 seconds. Is there something like a time out on background calls?

- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo {

   NSLog(@"Received push notification: %@", userInfo.description);
   [self.downloadManager syncData];
}
도움이 되었습니까?

해결책

From what I understand, you need to call this method:

[UIApplication beginTaskWithExpirationHandler:];
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top