1

It appears our Alamofire request gets "stuck" when we have a long running request where the app goes to background and then returns to foreground.

I understood that the request should be paused on background and resumed on foreground. It appears the resume isn't happening.

How should you handle this scenario? Is there some background specific implementation required here?

The request is a standard REST request to load data (with a default 60 second timeout). The case where we get "stuck" is when we have poor network connectivity. With decent network speed our request completes in less than a second.

Marcus Leon
  • 55,199
  • 118
  • 297
  • 429
  • Have you consider of call the request again instead? I think pause should be apply to download/upload task only – Tj3n Mar 17 '17 at 04:01

1 Answers1

0

It turns out I misdiagnosed the issue. The Alamofire request was still running and resuming when brought to foreground. The issue was really our UIRefreshControl got stuck due to a bug in the UIRefreshControl UIKit library. Implemented a workaround for that issue and we were good.

Community
  • 1
  • 1
Marcus Leon
  • 55,199
  • 118
  • 297
  • 429