1

Is it possible to execute a background task with [application beginBackgroundTaskWithName:@"LOG_STUFF" expirationHandler:^{}]; in the AppDelegate's method application:didReceiveLocalNotification:

nburk
  • 22,409
  • 18
  • 87
  • 132

1 Answers1

3

If your application is in the foreground, yes!

If your app is suspended (already in the background), the app has to be brought to the foreground for the "didReceiveLocalNotification:" method to fire and for you to be able to begin your background task.

Check out Apple's documentation for "beginBackgroundTaskWithExpirationHandler:" method for more details on how to properly use this API.

Michael Dautermann
  • 88,797
  • 17
  • 166
  • 215