简体   繁体   中英

Let multiple users sign in at the same time on 1 account

I am developing an android app where a user can register and login. Is there any way that multiple device can login to that account simultaneously and syncing with each other?

It's similar like Facebook where you can have multiple devices logged on 1 account at the same time. If i for example change my profile name on facebook from 1 device, then all other device will show that my profile name is changed.

Yes it is possible, in order for both users to be able to sync however, your best bet is a server that holds active connections to both devices or communicates with them in some other way.

Your devices could have an active connection to the server via sockets and every update sent by one client makes the server inform all other connected clients about having to update their state.

Alternatively you could also use push notifications to update your clients about updates that have happened on a different client.

Consider a chat, where people A,B,C are in the same group. When A sends a chat message, it is sent to the server and people B and C are then informed by the server about the new chat message arriving, ideally over an active connection (socket). Also they have to download all updates once they freshly connect to the server (the ones that happened while they weren't connected), in case they were offline at the time the message of A was received by the server.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM