Detecting a return to App on Mobile

Hey,
I’m trying to figure out how I can detect a return to the app on mobile, especially iOS.

Basically, i’m trying to achieve this:

  1. Open app, login
  2. Go to App’s main screen or whatever
  3. Switch app, so that the app is in background state
  4. Come back to the app natively
  5. Detect return to app and show welcome back pop up/screen.

Thanks,
Toby