This seems like an iOS bug. Strange, but the action of the screen NSURLSessionsomehow affects NSURLSession, so that it stops working and returns NSURLErrorNetworkConnectionLost. So in my application, I refused to use a shared session. I use a new session object for each request, or (if I need to constantly maintain one session), I recreate it every time the screen unlocks. And it works. AFNetworkingfor users AFNetworkingor any other third-party library working on top of the NSURLSessionsituation is more complicated. You will need to fix the library code, which is certainly not a good thing, but I think there is no other choice
source
share