ios6 - keep track of connected users on ios application -
i have ios app, users can login , logout whenever want. in server side, want know wich users online. set user online when login webservice called, , set offline when logout webservice called. but, cant sure logout done, maybe cellphone turn off, server keep user online, , when try login again error "sorry, logged in" maybe can feedback server (my app uses push notifications) dont know how fast detect user has gone offline... in these cases think best think app should ping server every x seconds , update kind of "last_online" field. then in logic, can consider example user last seen online more 3 minutes ago considered offline. like said, can't trust user click "logout" can't assume that's time logged out. of course can still let user click logout manually.