Search code examples
iosswiftalamofire

Run func() in background iOS app, not queued?


I'm using an Alamofire request method live() for the users but they need 1 hour download at least.

I'd like to run the method in background.

But not a queue which resumes after turn back to the app, instead working in background.

Is there any way using any library or framework to run the method in background?


Solution

  • There is one way for an app to run forever in background, and that's by calling requestLocationUpdates() from CoreLocation, but for that you need user's permission for Always Location and you'll also drain the battery quite a little. Other than that there isn't any method I'm aware of.