How to detect when application is closing

Hey ! I’m looking forward to learn how to detect when user is closing the app so we can execute one last block before it, is that possible ? If it isn’t, how would you guys suggest coming around it ? Thanks ^^

2 posts were merged into an existing topic: [Solved] Can I use a button to close an app?