title: URLSessionDownloadTask weird behaviour
body: <p>I have created a class to download file using <code>URLSession</code>. </p>
  
  <p>I noticed a weird behavior that when device in debug mode, it is downloading files. But if I remove device and run app manually, downloading is not working at all. 
  Sometimes re-attaching device starts the download.</p>
  
  <p>This is how I am creating URLSession : </p>
  
  <pre><code>private lazy var urlSession: URLSession = {
       let config                      = URLSessionConfiguration.background(withIdentifier: "org.company.id")
       config.isDiscretionary          = true
       config.sessionSendsLaunchEvents = true
       config.allowsCellularAccess     = true
     return URLSession(configuration: config, delegate: self, delegateQueue: nil)
  }()
  </code></pre>
  
  <p>And here is my request download function :</p>
  
  <pre><code>func requestDownload(urlString: String){
      guard let url                = URL(string: urlString) else {return}
      downloadTask                 = urlSession.downloadTask(with: url)
      downloadTask.taskDescription = urlString
      downloadTask.resume()
  }
  </code></pre>
  
  <p>Here is a link to that file downloader class : <a href="https://github.com/skdevil/PrakrstaFileDownloader" rel="nofollow noreferrer">https://github.com/skdevil/PrakrstaFileDownloader</a></p>
  
  <p>Any idea how to fix it ?</p>