title: Prevent websocket connection to drop when entering background state ios swift
body: <p>After doing lots of research it seems this is a grey area...</p>
  
  <p>I am trying to send occasional network requests via websockets once a user has entered the background state (using the Swift library Starscream, but I believe the problem is with iOS and sockets in general). Shortly after the user leaves the app, the socket connection automatically disconnects. I gather this has something to do with Apple's policy on 3rd party network activity in the background. </p>
  
  <p>In my AppDelegate, I have tried reconnecting when the user leaves, etc, but this does not work. I have also heard about workarounds involving playing audio, but apparently this will stop my app from being published to the App Store (if that's not the case, then why and how does this work?). Others say I need some sort of grant from Apple, how do I request this? It would be great for someone to clear this up, and provide a legitimate solution. I feel this is something that apps should be capable of, so I'm waiting to find a solution. </p>