How to call a Server action when the user kills the app

Hi All,

I am building mobile application that has a requirement to call a server action before killing it.

Scenario

1. User Kills the mobile app

2. The application will call a server action first to update a data before the app will close / killed completely

Is there an outsystems built in function that I can use to catch the kill event? something like OnClose?


Thank you

Hi Paul,

On a mobile screen you can attach a client action to  the OnDestroy event.

In that action you can call the server action.

Regards,

Daniel

Daniël Kuhlmann wrote:

Hi Paul,

On a mobile screen you can attach a client action to  the OnDestroy event.

In that action you can call the server action.

Regards,

Daniel


Thank you Daniel but the OnDestroy only triggered when the screen is closed and not the whole App. Do you think this is possible?

Is it not that when you close the app, also the screen is closed and thus destroyed?

Hi Paul,

I too had faced the same scenario with one of mine project while working in Native App Development. There is no way to detect the App Kill Event on any Platform [ Android / iOS ], sorry.

When a user or the system force stop your application, the entire process is simply killed. There is no callback made to inform you that this has happened.

When your application is killed in the background it is just killed. It is not woken up, and no methods are called on it. It is unceremoniously terminated and removed from memory. You cannot respond to this event. The same happens when the user force-quits your app from the app-switcher.

Thanks,

Assif