Hello,
Is it possible using Moya to perform an URLSessionUploadTask in background to send for example image even if the user return to home?
Thanks in advance!
Hey @XavierDK. You can create your own Manager and pass it to the MoyaProvider:
let configuration = URLSessionConfiguration.background(withIdentifier: "com.example.app.background")
let manager = Manager(configuration: configuration)
Let us know if it helps!
Edit: Also, see how the default Manager is created here.
Thank you @sunshinejr! It's exactly what I was searching about.
Glad it worked! 馃帀
It seems this is not possible any more with the latest version since it depends on Alamofire 5 which disabled background sessions: https://github.com/Alamofire/Alamofire/commit/1d5411cdde887cb9c8d282239fa4a44d42bd5e9f
Any other solutions?
How can I do that? As @teameh said it is no longer available this usage?
@yunustek At the moment it looks like the way you can solve it by switching from Moya/Alamofire to native URLSession.
Okay thanks @polurezov8
Most helpful comment
@yunustek At the moment it looks like the way you can solve it by switching from Moya/Alamofire to native URLSession.