I am developing an app which is connected to a server through .net api.
What user logs in it generate an access token which is used to make network calls.
Requirement: After 20 mins of the generation of that access token, the token gets expired and the user have to log in again to continue using the app.
How can I achieve this feature that after 20 min the user will get logout from app and redirected to the home page.
If the user is using app even after 20 min from login? how to save the access token in app and remove it once user logout.
I have seen a couple of answers in Objective c but I want the answer in swift.