title: IOS: download of multiple files in background
body: <p>Im developing an app that have to download multiple files. I have no problems when the app is in foreground.<br/>
  To continue the download when app is in background i'm using the following code (from <a href="https://stackoverflow.com/questions/8861390/ios-background-downloads-when-the-app-is-not-active">iOS Background downloads when the app is not active</a>):</p>
  
  <pre>
  
      self.backgroundTask = [[UIApplication sharedApplication] beginBackgroundTaskWithExpirationHandler:^{
              [[UIApplication sharedApplication] endBackgroundTask:self.backgroundTask];
              self.backgroundTask = UIBackgroundTaskInvalid;
          }];
          /* Here your downloading Code, let say getDataFromServer method */
  
          [self getDataFromServer]; // Its dummy method
  
          /* Your downloading Code End Here */
  
          dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
  
              [[UIApplication sharedApplication] endBackgroundTask:self.backgroundTask];
              self.backgroundTask = UIBackgroundTaskInvalid;
          });
  
  </pre>
  
  <p>This code is ok until the device screen is on. But when the device goes into standby, something happens and download stops. Probably ios closes active internet connections of my background process.</p>
  
  <p>Is there a way in IOS 6 and 7 to keep the connection alive during standby?</p>