I use URLSessions to do my network calls and it always fails when I put my app to background state.
When I bring the app to foreground state, the URLSession give URLResponse as nil.
How can I make it work in background state?
I use URLSessions to do my network calls and it always fails when I put my app to background state.
When I bring the app to foreground state, the URLSession give URLResponse as nil.
How can I make it work in background state?
You can get URLSession to work in background state if you configure session for background download or upload. But if you use session for regular backend API call, best that you can do is to repeat call after application enter foreground again.