UPGRADE YOUR SKILLS: Learn advanced Swift and SwiftUI on Hacking with Swift+! >>

How to avoid timeout , when app moves to background

Forums > Swift

I have URLSessionRequest timeout set for all of my API calls. My requirement is to extend the background processing of all the API call i.e. if any network call is in progress and app moves to background, should extend its processing and once it comes to foreground should retry the request.

I am using backgroundTaskId for background processing and app is not getting terminated or killed, but API calls are getting timeout after timeout period which is set.

I want timeout for all the API calls to be avoided, if app moved to background and once app comes to foreground retry the same API call.

Any input is appreciated.

2      

TAKE YOUR SKILLS TO THE NEXT LEVEL If you like Hacking with Swift, you'll love Hacking with Swift+ – it's my premium service where you can learn advanced Swift and SwiftUI, functional programming, algorithms, and more. Plus it comes with stacks of benefits, including monthly live streams, downloadable projects, a 20% discount on all books, and free gifts!

Find out more

Sponsor Hacking with Swift and reach the world's largest Swift community!

Archived topic

This topic has been closed due to inactivity, so you can't reply. Please create a new topic if you need to.

All interactions here are governed by our code of conduct.

 
Unknown user

You are not logged in

Log in or create account
 

Link copied to your pasteboard.