We would like to track when the app is terminated by a user so we are using ‘applicationWillTerminate’ method. sometimes it’s working fine but sometimes we can not store data because the app is terminated so is there any other way to track that.
We have tried ‘applicationWillTerminate’ method. We can another method if there is any.
2
Answers
Try using
applicationDidEnterBackground
function.If you check the iOS app life cycle your app didn’t get directly in suspended state.
According to Apple:
you can read more details about Managing your app’s life cycle here.
check this image for quick look
For my suggestion, you can try Firebase Crashlytics for tracking the app terminated by the user.