How to run procedure in background when the app is closed?

Hello everybody … i would like to run a background function when i closed the app i want to run function each 3 seconds.
is there any way to do this in nNiotron and How?

thanks !

Can you explore more which functions ??

Try on app stop block it Will work

i want to get calllog numbers when app is closed and run in background !
using Calllog extesntion

You might need to use some extensions for this functionality.