not sure about any demo applications, but you have hooks for this, for example ...
application delegates application WillEnterForeground 'and' applicationDidBecomeActive '
It may also matter if your application is turned on in the background or not, how you intend to implement it.
In my application, I have a setting for navigating the user to the main screen at any time when the application becomes active / goes to the forefront. The main screen controller then determines whether the user will still be logged in / active, and if he does not push the stack entry controller.
Augie source share