is it possible to maintain the logged in state of a user on simultaneous android devices at the same time?
Is it possible to maintain simultaneous logins of a single user on different Android devices at the same instance?
Suppose user 'X' logged in on device '1', then the same user 'X' logged on device '2', would it be possible to handle such scenario?
If yes, would it be possible to maintain/k开发者_如何学Ceep track of the number/quantity of such devices and to put a limit on such number of Android devices?
This requires more server side magic than client side.
When ever a user logs in you need to let a server know that the user is now logged in. Now when the user opens the app on device 2 you first need to make a call to the server to ask if the user is logged into some other device , if yes the server needs to send a secure token to allow the app to log in . Note Security will be a big issue if not handled correctly.
If you want it done in real time you need to set up some sort of push messaging system that your app can listen to from the server and then log the user in on device two.
Now the server has a lot of control on the number of devices the user can be logged into. But you need to decide how you will handle cases where the user will not have a data connection.
精彩评论