Hi
We have a problem on some devices with the event applicationWillTerminate being called just after the app has entered background mode. I have myself logged the problem on a iPhone 6 and iOS 8.
The documentation says:
For apps that do not support background execution or are linked against iOS 3.x or earlier, this method is always called when the user quits the app. For apps that support background execution, this method is generally not called when the user quits the app because the app simply moves to the background in that case. However, this method may be called in situations where the app is running in the background (not suspended) and the system needs to terminate it for some reason.
Our app indeed supports background execution, and it is for some reason terminated when user is pressing the Home button.
This does only occur on a very small amount of tested phones, but it can occur. Is there anyway to debug the real reason behind the decision to terminate it. Because without having the real reason, fixing it is extremely difficult.
Thanks!
--Anders
Correct, we build with a modern SDK and don't have UIApplicationExitsOnSuspend. And we are not using "older" devices, iPhone 5 and up.
For your information we are using Location Services to collect GPS data while the app is in the background. We are also using Cordova in our app.
I also assume memory pressure is the most likely cause. I have also seen examples when the app has been terminated without any notification previously in applicationWillTerminate (at least the I/O write to log the event is lost), and not even a report in the crash report logs.
- If there is no logged crash report after the crash/kill, for what possible reasons can iOS determine that an application must be terminated? Besides obvious reasons like using the multitasking UI and swipe up, and memory pressure.
We are trying to learn in what areas we can improve the app, to reduce the risk of being killed.
Thanks!
--Anders