-2

i tried with this code but not work

let manager = Alamofire.SessionManager.default
manager.session.configuration.timeoutIntervalForRequest = 60
manager.upload( ....

any other ways or what's wrong with my code

EDIT : For request upload image

Rahmat Hidayat
  • 113
  • 1
  • 2
  • 6
  • 2
    Possible duplicate of [Set timeout in Alamofire](https://stackoverflow.com/questions/41803856/set-timeout-in-alamofire) – mag_zbc Jul 04 '18 at 08:52
  • i don't think its duplicate as they are setting request timeout NOT session timeout. These are 2 different thing – Abhishek Thapliyal Jul 04 '18 at 08:53
  • @AbhishekThapliyal, i think you didn't read question properly. As he wants to set request timeout not session timeout. – Pankil Jul 04 '18 at 09:07

1 Answers1

0

Try this

 let alamoFireManager = Alamofire.SessionManager.default
 let configuration = URLSessionConfiguration.background(withIdentifier: "com.url.background")
 configuration.timeoutIntervalForRequest = TimeInterval(requestTimeOutInterval)
 alamoFireManager = Alamofire.SessionManager(configuration: configuration)