In iOS Swift, After app is sent to background and taken back, response is not coming if the request is kept open for 30 seconds


In Swift, I am using the urlsession framework for fetching data from APIs. I am adding requests into operationqueue and internally I am doing an operation to make sure the fire in FIFO format. I sent a request and the backend will only respond after 30 seconds of receiving the request. Its all working fine if app is not minimised.

If I sent a request, then suddenly send the app into background (not close) and after 8-10 seconds if I take the app to foreground, then I am receiving the response.

Since my app is not supporting any background modes, is this behaviour because the requests are somehow dying when I sent the app to background?

Latest articles

spot_imgspot_img

Related articles

Leave a reply

Please enter your comment!
Please enter your name here

spot_imgspot_img