Frage

I'm developing an application for iOS and i need to be able to detect when an app really closes and not when he go to background..

I already try to catch the signal SIGKILL with signal function but signal handler never has been called.. I'm using push notifications and i have to register the device in the server for the server send notifications to him when application starts (and that its possible) but i have to unregister the device when the device quit the application and not when the device have the application in background..What i can do for doing this?

Regards

War es hilfreich?

Lösung

If the OS kills your app for any reason, it is killed. There is no notification. You can't catch the SIGKILL signal. Look at the man page for kill.

Andere Tipps

Detecting when app closes in all the cases is not reliable in iOS (nor it is in other OS). By design, you should avoid it.

Change your design and do not unregister the token from the server. In Apple Push Notification service, the app token is still valid after app is closed and you may use it to deliver a push notification when the app is not running.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top