I'm using background fetch in an iOS app to schedule some notifications and I need to fetch some data from server But when i create an Alamofire request the surver returns the data but alamofire does not calles my compilation handler (responseString)
the exact same code works perfectly while my app is on forground.
Alamofire.request(url, method: method ?? HTTPMethod.get, parameters: parameters,
encoding: encoding ?? URLEncoding.default, headers: headers)
.responseString{
(afResponse : DataResponse<String>) -> Void in
....
}
I used AlamofireNetworkActivityLogger to check weather the response is created and fetched and the result was true. but my compilation handler not getting called!
any thing else should I consider while using Alamofire in background?