1

How to detect when an iOS app is terminated by the user from the multi-tasking UI without using 'Location updates' capability. I know from the Apple's documentation that 'applicationWillTerminate' function in AppDelegate is not called in such a scenario. App Programming Guide for iOS

Suspended apps receive no notification when they are terminated; the system kills the process and reclaims the corresponding memory. If an app is currently running in the background and not suspended, the system calls the applicationWillTerminate: of its app delegate prior to termination. The system does not call this method when the device reboots.

In addition to the system terminating your app, the user can terminate your app explicitly using the multitasking UI. User-initiated termination has the same effect as terminating a suspended app. The app’s process is killed and no notification is sent to the app.

But when we set 'Location updates' capability, allowsBackgroundLocationUpdates = true and startUpdatingLocation() then the function 'applicationWillTerminate' is called. My question is that is there any workaround or any other capability where 'applicationWillTerminate' is called without using 'Location updates'.

Community
  • 1
  • 1
Rahul Racha
  • 19
  • 1
  • 4

0 Answers0