Hello,
Is it possible to make the api calls with alamofire's background mode option, so that tasks can contirnue in the background in Swift 3?
https://github.com/Alamofire/Alamofire#creating-a-session-manager-with-background-configuration
Thank you.
This link is invalid. @ahmettaha
How about this?
What kind of tasks do you need to run? I think downloading something will work with session manager and then the session will be closed after download but updating a certain status or sending requests to API routes every now and then will not work.
Background fetching on iOS runs only for 3 mins then stops. Even the timer that you add to run a function every now and then will stop.
Your only option is to send remote push notification from the server upon a certain event happening on the server itself to make the user get the app on the foreground when opening the notification. And then fetch the updated data.
3 minutes is enough actually.
Great. Then check this link. It will help you to start background fetch sessions.
https://www.raywenderlich.com/143128/background-modes-tutorial-getting-started
Hello,
Thank you. I know how to do start upload and download tasks in the baskground with Alamofire. However, I was wondering if such support exists with swagger generated code for swift 3
I got it figured out. If you prefer, I can try to put it in a pull request?
@ahmettahasakar
I have same a question, and i haven't resolved it. I was searching your pull request but not found.
Can you share your way figured it.
Thank you!
Hello,
I ended up not using swagger for background upload. I just used Alamofire alone.
@ahmettahasakar Can you point us to the references that helped you to achieve the task. I am looking for a way to upload few hundred mb of data over Alamofire in background.
It has been a while, but it was something like this
https://gist.github.com/toddhopkinson/60cae9e48e845ce02bcf526f388cfa63
Hey, thanks for the reply... Looks like the link is broken. It is throwing a 404
I have same question but here, I need to send location to server when app goes background mode. can you help me
It's best if you save the location in a file, and upload that file in the background, and process the file contents on the server. If it hasn't changed, background transfer tasks were only allowed for file transfers.
Most helpful comment
Hello,
Thank you. I know how to do start upload and download tasks in the baskground with Alamofire. However, I was wondering if such support exists with swagger generated code for swift 3