One way I thought was to check the timestamp from the last time it was run to the current timestamp and determine if the user needs to be logged out (from the app’s member section). Another developer suggested creating Android services. Would like to know a good approach to automatically forcefully logout user after 24 hours since last time they ran it.
Share
To automatically forcefully log out user after 24 hrs you need to save the logout time on server, check every time the app starts and log him/her out. This is because the app may be uninstalled and then all the saved time stamp data will be lost.
Note that it is quite OK to save the time stamp and restart the login process when the app get uninstalled and re-installed. Many apps do this. But if this is a financial app then it is a good idea to control logout from server, it gives you more flexibility and control.