I think this might be answered quiet a few time, but still there are some unknown cases that I wanted to clarify.
I have been looking at Background Fetch API for one of my iOS application. I learned from several articles that fetchNewDataWithCompletionHandler
will get called when OS decides to check if there is any new data from backend server(irrespective of what custom fetch interval we set). And the articles and tutorials says it will get called only if your application is in inactive/background/suspended state, not when user forcefully terminate the app from app switcher.
But my questions are;
- In WWDC 2013 video the instructor says:
There are two very important scenario to test, first scenario is when your app launched in background to fetch new content, and second one is your app resumed in background to fetch new content.
I think the second scenario is app resumed from background/suspended state. But what is this first scenario? From which state our app will "launch" in background to fetch data? From not running state?
- To test background fetch there are two options, one is to create new scheme with 'Launch due to background fetch' and other one is from debug / simulate background fetch. I think the second one is to simulate the background fetch when the application is in background or suspended. But what is the first case? Is it something about when application is not running(removed from app switcher)?
Any thoughts?
Thanks!!