function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Jyoti Singh 9Jyoti Singh 9 

Logout user if mobile app not used for one day?

Can I force a user to be logged out if they don't use my app for one day? How and where to specify this setting for Mobile SDK based hybrid apps?
Best Answer chosen by Jyoti Singh 9
Gaurav KheterpalGaurav Kheterpal
You can do this by setting the Access Token policy in the connected app to this setting

Expire refresh token if not used for n. This setting invalidates the token if it is not used for the amount of time specified. For example, if the field value states 7 days, and the refresh token is not exchanged for a new session within seven days, the next attempt to use the token fails. The token expired and can no longer generate new sessions. If the refresh token is successfully used before 7 days, monitoring the period of inactivity resets, and the token is valid for another 7 days.

In your case, set it to 1 day.

If my answer helps resolve your query, please mark it as the 'Best Answer' to benefit others and improve the overall quality of Discussion Forums.

Gaurav Kheterpal
Certified Force.com Developer| Developer Forums Moderator| Dreamforce Speaker