This code will let you see the status of the app if it has opened or closed.
local onSystem = function( event ) if event.type == "applicationStart" then print("start") elseif event.type == "applicationExit" then print("exit") elseif event.type == "applicationSuspend" then print("suspend") elseif event.type == "applicationResume" then print("resume") end end -- setup a system event listener Runtime:addEventListener( "system", onSystem )
You will need to set your local notification on app exit, and cancel it on application start. Also when app starts, you can take in the OS time and calculate 1 week from that date that you can pass into the app exit logic.
Hope this helps