title: I want to do a download that can continue in the background in swift, but when I switch to the background, the bluetooth file transfer stops
body: <pre><code>func applicationDidEnterBackground(_ application: UIApplication) {
      print(&quot;Entered Background&quot;)
  
      bgTask = application.beginBackgroundTask(expirationHandler: {
          self.bgTask = UIBackgroundTaskIdentifier.invalid
          self.cb_central = CBCentralManager()
          self.cb_central.delegate = self
          
          self.centralManagerDidUpdateState(self.cb_central)
          Definations.isFileTransferInProgress = true
          VoiceRecordMainVC().downloadFile()
      })
     
  }
  
  func applicationWillEnterForeground(_ application: UIApplication) {
      UIApplication.shared.endBackgroundTask(bgTask)
  }
  </code></pre>
  <p>I have such a code and when it goes to the background, I tell the download to continue, actually I am telling it to start the download again. Do you think it is possible to do this and how can I do it, thank you for your help.</p>