I just ran into same problem what if you add a timer to your app that is being refreshed every sec, and if time ever runs out it will mean app was closed.