How can one test the scenario of Application Launch in background for handling Background NSURLSession's event?
Flow:
- Application starts a upload/download task using Background URL session.
- User hits home button. App is in suspended or in background state.
- OS decides to Exit the application. I know, one can exit the app by double-tapping home button and swipe-up the particular app. But in that case OS will never re-launch the app in background for event handling.
- Upload/download task needs some event handling. OS re-lauches App in background.
So the question is how do I make OS exit the app like it may normally do after some-time. The purpose is to test the code for this scenario. I tried using UIApplicationExitsOnSuspend but it does not work since then App can not be launched in Background.