Application have a functionality for Saving and Restoring State Information. It uses the APIs shouldSaveApplicationState and shouldRestoreApplicationState in App delegate and application:willEncodeRestorableStateWithCoder and application: didDecodeRestorableStateWithCoder in the corresponding view controller class. Thus the application restores the state even after force quitting the application from any state. This was working fine till iOS 8.x.
From iOS 9.x, it is found that the restoration is not working when application is force quit the application from foreground. This is because the shouldRestoreApplicationState method is not triggered while application is launched again.
In all other scenarios, application restoration functionality is working fine as expected.
There is no code change done to our application but the application behaves differently now.
Please help as this is one of the key functionality of the application.
This is by design. The following is from the Apple documentation:
The system automatically deletes an app’s preserved state when the user force quits the app. Deleting the preserved state information when the app is killed is a safety precaution. (As a safety precaution, the system also deletes preserved state if the app crashes twice during launch.) If you want to test your app’s ability to restore its state, you should not use the multitasking bar to kill the app during debugging. Instead, use Xcode to kill the app or kill the app programmatically by installing a temporary command or gesture to call exit on demand.