Mobile application focus events?


Is there a way to listen to application focus event on mobile (or PC)? I’m working on a fast paced game and would like to pause the game when it goes out of focus so the player has to manually unpause when the game is brought back into focus.