-2

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 Answers2

0

Try using applicationDidEnterBackground function.

If you check the iOS app life cycle your app didn't get directly in suspended state.

According to Apple:

When the user dismisses your app’s UI, UIKit moves the associated scene to the background state and eventually to the suspended state.

you can read more details about Managing your app’s life cycle here.

check this image for quick look enter image description here

Naqeeb
  • 1,121
  • 8
  • 25
0

For my suggestion, you can try Firebase Crashlytics for tracking the app terminated by the user.

Bun
  • 1
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community May 16 '23 at 15:15