What Command can i use when app is opened

Hi

i would like to update app every time user opens app

How would i know when user has opened app or if program is already open and user is viewing app again

which command would i use

thankyou

https://docs.coronalabs.com/api/event/system/type.html

https://docs.coronalabs.com/api/event/system/type.html