User overview
App users must connect to the service to use instant messaging. A user is an App user who holds a valid token issued by the platform and connects to use instant messaging services.
Register user
The application server (App Server) provides the App user's user ID (userId) to the server to obtain a unique user token. For the platform, this step of obtaining a token with userId is registering a user, and must be completed by calling the Server API.
The application client must hold a valid token to successfully connect to the server and use instant messaging services. When an App client user sends a login request to the server, the server queries the database to check whether the connection request matches.
Registered user limit
- The registered user limit in the development environment? is 100.
- In the production environment?, there is no limit on registered users after upgrading to IM Flagship Edition or IM Premium Edition.
Delete user
Deleting a user means deleting registered test users through the console in the application's development environment to control the total number of test users. This operation is not supported in the production environment.
Deactivate user
Deactivating a user means deleting user data from the service. Apps can use this capability to implement their own user account cancellation function to meet App store or compliance requirements.
After the platform returns a successful deactivation result, data related to the user ID is deleted. You can query all deactivated user IDs. If needed, you can reactivate a deactivated user ID (note that user personal data cannot be recovered).
Only the IM Server API provides these capabilities.
User information
User information refers to data such as user nicknames, avatars, group nicknames, and group avatars. By default, Chat UI SDK uses Nexconn-hosted profile data. If your app does not want to host profile data in Nexconn, use the app-managed provider mode and maintain user information on the application side.
Friend relationship
By default, Chat UI SDK uses Nexconn-hosted relationship data for friend relationship features. If your app does not use the friend relationship management service, maintain friend relationships on the application server (App Server).
If you are not using the friend relationship management service and need to restrict message sending behavior between client users (for example, if all userId values are leaked, allowing a malicious user to send messages to any user bypassing friend relationships), consider using the user whitelist service. Once a user enables and sets a whitelist, they can only receive messages from users in that whitelist.
If using the friend relationship management service, non-friends can also send messages normally by default. If you need to restrict message sending to friends only, you can enable this feature in the console under IM Service > Feature Configuration > Friends > Only friends can send direct messages to each other.
User management interface
| Feature category | Feature description | Client API | Server API |
|---|---|---|---|
| Register user | Use the App user's user ID to obtain a token. | Not provided | Register user |
| Delete user | See Delete user above. | Not provided | Not provided |
| Expire token | Expire tokens obtained before a specific time point. | Not provided | Expire token |
| Deactivate user | Deactivating a user means disabling the user ID in the service and deleting user personal data. | Not provided | Deactivate user |
| Query deactivated users | Get the list of deactivated user IDs. | Not provided | Query deactivated users |
| Reactivate user ID | Re-enable a deactivated user ID in the service. | Not provided | Reactivate user ID |
| Set local user information | Set the user information provider, with the application layer responsible for providing data. | Set user information provider | Not provided |
| Set server user information | Set the user name and avatar used in the push service. | Not provided | No separate API provided. User information must be provided when registering a user. |
| Get local user information | Get user avatar, nickname, and other information displayed on the channel page, friend list, etc. | Get user information | Not provided |
| Get server user information | Get user information registered on the server, including user creation time and the user name and avatar URL used by the server push service. | Not provided | Get user information from the server |
| Modify local user information | Modify user nickname, avatar, and other information saved in the local client database. | Refresh user information | Not provided |
| Modify server user information | Modify the user name and avatar used in the push service. | Not provided | Modify user information |
| Block user | Prevent a user from connecting to the instant messaging service and immediately disconnect. Can be unblocked by duration or manually. Query blocked user IDs and block end time. | Not provided | Block user, Unblock user, Query blocked users |
| Query user online status | Query the online status of a user. | Not provided | Query online status |
| Blocklist management | Add or remove users from a user's blocklist. Users in A's blocklist cannot send messages to A. ChatUI handles the blocked error by default, displaying "Your message has been sent but was rejected by the recipient." The client can directly use nexconn API: NCEngine.userModule.addToBlocklist/removeFromBlocklist/checkBlocked/getBlocklist. | NCEngine.userModule.addToBlocklist, NCEngine.userModule.removeFromBlocklist, NCEngine.userModule.checkBlocked, NCEngine.userModule.getBlocklist | Add to blocklist, Remove from blocklist, Query blocklist |
| User whitelist | Once a user enables and sets a whitelist, they can only receive messages from users in that whitelist. | Not provided | Enable user whitelist, query user whitelist status, add to whitelist, remove from whitelist, query whitelist |