ios - Maximum time Intervel for NSTimer -
in our application have auto log out user if doesn't logged in week.
what best method schedule it? used nstimer
time interval of (24*7*60*60) work?.
nb: login screen automatically shown after terminating app. case occurs when app minimized week
nstimer gets paused when app in background. there every chance user run other apps, app go background.
i tackle problem this
- when user login, take current time (
nsdate
) , save innsuserdefault
key "lastlogintime". - whenever user starts/resumes app check current time saved time. if difference greater 1 week, call logout.
- if difference less 1 weak, update
nsuserdefault
value current time.
Comments
Post a Comment