The above interface TUIUserService.switchUserStatus is only effective after a successful sign in, please make sure to call this interface only after signing in.
Here is the example code to enable user online status by calling this interface after signing in:
Supplementary Information: How does TUIKit internally achieve the "user online status" feature?
Note:
The following content is only for the purpose of auxiliary reading. The user online status feature is already included in TUIKit by default, negating the need for manual implementation by the user.
Both the TUIConversion and TUIContact components support the "User Online Status" feature. The TUIContact is given as an example for discussion below:
1. Monitor User Online Status List Changes
In TUIKit/components/TUIContact/contact-list/index.vue, monitor changes in the user online status list:
When invoking the Subscription/Cancel Subscription API, the interface prompts the error code "72001"
The error code 72001 indicates that the corresponding capability is not enabled on the console, please sign in to the Chat Console to activate the corresponding functional switch.
Error: The package does not support the usage of this API, please upgrade to the Pro edition 、Pro Plus edition 、Enterprise edition
The "User Online Status" feature is only supported by the premium package. This error message indicates that your current package does not support this capability.