Add onDestroy action to Mobile application

On our radar

Hey there,

I have done a mobile project at my work. I wanted to run a trigger on the background of the app like a Android Service ( which also runs after destroy ), but it was not possible. It will be very usefull if a onDestroy action would be added to the application itself. It is available for the screens, but not for the applications!

Thanks a lot!

Created on 20 Dec 2017
Comments (3)

Both Android and iOS have application states like OnApplicationDestroy and OnApplicationPause, so I think this could be done:

Android Application LifeCycle

iOS Application Lifecycle

Hello Furkan

Like Matthias illustrated, the events exist. For Android, there's already a plugin you can use (cordova-plugin-ondestroy). For iOS, you will probably have to create a new plugin. Take a look at Apple's documentation, particularly the "applicationWillTerminate".


Hello Matthias and César,

Thanks for the reactions. I had a problem with running a service after the onDestroy of the application. It would be very nice if Outsystems had implemented this in the mobile. I will use the plugin which César recommended.