0

I have an app that uses background services, so because of this, ApplicationWillTerminate actaully never gets called, intead ApplicationWillEnterBackground gets called when a user TERMINATES not closes an app.

The issue is I need to be notified when the user specifically terminates the app, not just closes it.

What can i do to obtain my desired results?

Something i have thought about is using the application variable, but the only thing I can find in the variable is an applicationState variable, and it's 2 both when closing the app and terminating the app

Travis Delly
  • 1,194
  • 2
  • 11
  • 20

1 Answers1

0

At first :Closing and terminating app : I don't think there is a difference between them. I think you mean to say Minimising(Pressing Home button) app and Termination.

Application will not be terminated if user press home button, Instead it will be sent to background thus calling willEnterBackground.

There is no way to detect if app is forcefully closed by User.(Open Multi tasking and swipe app).

App will terminate will be called when app is killed by System for any reason like memory usage, inactivity etc. This termination will call appWillTerminate

Devang Tandel
  • 2,988
  • 1
  • 21
  • 43