Hello Ricardo,
Hope you're doing well.
I had to do a similar thing back in a day for a mobile app that I was working on.
Unfortunately, there is no system event for On Application Pause directly on Service Studio.
However, I managed to do it using some JavaScript code.
Since I wanted to run my logic in every single screen, I created a Block for this purpose that I placed inside my application's layout. This way I was sure that it was present in all of my screens.
In this Block's OnReady event, you just need to add an event listener, like this:
document.addEventListener("pause", $actions.OnPause, false);
Then you just need to create a screen action called OnPause where you can put the logic that you want to run when your app goes to background.
In the same block, I advise you to remove the event listener as well so you don't add several unnecessary events. You may do it using some JavaScript on OnDestroy event:
document.removeEventListener("pause", $actions.OnPause, false);
Alternatively , there is a Forge component that seems to handle some mobile native events, including Pause event:
https://www.outsystems.com/forge/component-overview/3408/mobile-events
I never used it, but I was checking its code and it seems very similar to what I just described. Honestly, I would give it a try :)
Hope that this helps you!
Kind regards,
Rui Barradas