In my app, i download around 25mb+ data. During the download process if the user press the center button and app goes background what should be done so that the download continues once the app comes to foreground
Check out the Executing Code in the Background section of the iOS Application Programming Guide, which says:
Any time before it is suspended, an application can call the beginBackgroundTaskWithExpirationHandler: method to ask the system for extra time to complete some long-running task in the background.
You have a little bit time to store and decide to do something when the app goes into the background. I think the best way is you cut your data off by some way.
If it is text data, it will be easy, just break into many smaller text files and remember what you downloaded.
If it contains lots of images and videos, save the last (may be index) of the image or video you downloaded.
Generally, try to break up your data to many smaller ones so that a break in one will not affect other parts and you can redownload that part.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With