Yes, it's pretty straightforward, although I don't believe Alamofire
provides it natively. Since the library does allow you to make network requests, though, it's fairly straightforward to just retry with an exponential backoff if you fail with a 500
error. Concretely, in the completion block of your Alamofire
requests, you check the status code, and if it's 500
, retry after a delay. That delay should be stored in some singleton at the level of your network manager, and be increased along an exponential delay curve of your liking as failures occur. It should then be reset to the base delay when your request succeeds.