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 in nsuserdefault 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

Popular posts from this blog

vb.net - Alternative to the T-SQL AS keyword -

php - MySQLi binding parameters in a prepared statement doesn't work unless inserted after "WHERE" -

ios - CFRelease causing crash in iPad application -