I have an iOS app with downloading function. It downloads a file to a temporary folder and then move it to a special folder. But the process can be disturbed by an incoming phone call. When the app is in background for enough long time, the downloading process is gone maybe due to the system killed the app. I wonder if there is a good strategy for solving it. One solution that I can think is to detect the incoming phone call and resume the downloading when the app starts again. Do you have any suggestions? Thanks!
For downloading you can use the background transfer service introduced in iOS 7. This allows the download to continue even if your application is pushed to background and the download takes a long time.
You can also pause/resume the download if needed using possible events from the OS.