0

I start a BackgroundTaskWithExpirationHandler when the application waken up by significant change location update. is it important to close the task as below:

if (bgTask != UIBackgroundTaskInvalid)
    {
        [[UIApplication sharedApplication] endBackgroundTask:bgTask];
        bgTask = UIBackgroundTaskInvalid;
    }

what would happen if I didn't close the task.

rishi
  • 11,779
  • 4
  • 40
  • 59
user836026
  • 10,608
  • 15
  • 73
  • 129

1 Answers1

0

Yes, it is important. Otherwise battery will be drained out soon.

Check the memory usage details of background apps here - http://developer.apple.com/library/ios/#DOCUMENTATION/iPhone/Conceptual/iPhoneOSProgrammingGuide/ManagingYourApplicationsFlow/ManagingYourApplicationsFlow.html

rishi
  • 11,779
  • 4
  • 40
  • 59
  • But my understanding that anyway the OS will give application 10 more minutes to run. so i expect even if I didn't call it, my apple will be killed after 10 minutes. – user836026 May 30 '12 at 14:11