Multi-device Login
Update time: 2024/08/20 15:45:46
Overview
NIM SDK supports multi-device login. NIM SDK supports the configuration of four different multi-device login policies:
- One login session. Only one login is allowed for Windows, Web, Android, and iOS clients.
- Restricted simultaneous logins. Simultaneous logins among Desktop clients and Web apps are not allowed. Logins from Android and iOS apps at the same time are not allowed. Desktop apps and mobile apps can log in simultaneously.
- Unlimited simultaneous logins. All clients of different platforms can log in at the same time
- Custom multi-device login configuration
Log in to the CommsEase console and go to the "Configuration" under the IM service in your project. You can configure the multi-device login policy.
Allow one device
If you enable "Allow only one login session", the same account is only allowed to log in on one device. When the account is successfully logged in on another device, the new login will invalidate the previous login session.
Restricted simultaneous logins
To apply "Concurrent Mutually Exclusive Logins", the same account can be logged in on a maximum of one desktop device (PC or web) and one mobile device (iOS or Android).
Later login sessions invalidate earlier login sessions in the following cases:
- Your account is online on a desktop device (PC or web) and you log in on another desktop device (PC or web).
- Your account is online on a mobile device (iOS or Android) and you log in on another mobile device (iOS or Android).
Later logins and later logins are valid in the following conditions:
- Your account is online on a mobile device (iOS or Android) and you log in on another desktop device (PC or web).
- Your account is online on a desktop device (PC or web) and you log in on another mobile device (iOS or Android).
Unlimited simultaneous logins
Up to 10 devices can be online at the same time. If you log in on devices within the upper limit of the devices, the prior login sessions on other devices will not be invalidated.
Custom multi-device login
Login configuration
If the previous login policies cannot meet your requirements, the SDK v7.8.0 or later allows you to customize the multi-device login policy. Log in to the CommsEase console, go to Configuration under the IM service of your project and select "Custom Multi-device Login" in "Multi-device Login" to configure the custom multi-device login policy.
As shown in the figure above, CommsEase provides 5 built-in client types, iOS, Android, macOS, Windows, and Web. If mutually invalidating logins are applied, you can select required platforms for invalidating previous login sessions.
For example, if you need to implement invalidating logins between iOS and Android devices, select the second row and third column in the table. In this case, the third row and second column will also be automatically selected. To allow iOS and web devices to have concurrent logins, make sure that the third row and sixth column are not selected.
You can add new types of clients if your device is not inclided in the built-in client types. Click the "Add" button below, select the "custom" client type, and name the new terminal type with an integer number, and click "OK" to add a custom client type.
To delete a certain type of client, you can also select the checkbox on the left and click Delete to remove the type.
After the configuration is complete, click Save to apply the settings.
Apply settings
You must configure the custom client type for initializing the SDK. After configuring this field, follow the custom multi-device login logic. If the argument is not passed, use a predefined client type (iOS, Android, Windows, and Web) For specific methods, see the relevant sections in the API reference for specific platforms: