This is what I need:
- call post api
- if success: do nothing
- if failed (no internet access): put the request on the stack
- monitor if the network is back.
- if network is available: try again in this stack
even if the user closes the application, I still need to have an accessible stack. I need to save the stack to disk
Here is what I plan to do:
- have an apiRequest class, it contains
- has an apiRequestManager class, it contains
The apiRequest array is stored on disk. Every time the user wants to call api, I first call Alamofire.request, and if that fails, put it in the apiRequest array.
NetworkReachabilityManager , . true, apiRequest. , , . .
, Alamofire. , , Alamofire.
, RequestRetrier. , , , , , , ?
?
.