Chat Room Tags

Update time: 2021/12/06 03:19:26

Introduction to features

The chat room feature of NetEase ConnectEase helps the developer build an in-app chat room widely used in social entertainment and education live streaming. By default, the chat room messages will be sent to all online members in the chat room. Starting from V8.4.0, the chat room tag feature is added to flexibly send the chat room messages to some members in the chat room. Specific messages may be received as well.

Application scenes

Super mini class

Large multi-person class is integrated with mini class interaction. When a teacher gives lectures, students may be grouped into several mini classes for management and education interaction, thus saving the teaching cost of live streaming large classesand improving the effect of interactive teaching of mini classes.

The figure above shows a typical super mini class scene:

  • All class members are in the same chat room
  • Teachers may send messages to all classes, and receive the discussion information of all classes
  • Students can only receive the discussion messages in classes, and the messages sent will be only visible in classes
  • The teaching assistant may make configuration at his/her sole discretion to manage a class or several classes

Large live streaming chat room

In a large live streaming chat room, in consideration of barrage refreshing and debate, users may be grouped by tags to yield the following effect:

  • In the live streaming of multiple stars or entertainers, internal interaction is supported among the fans of any of the stars or entertainers, but there is no interaction among the fans of different stars.
  • In sports competitions, e-sports or other competitions, audiences may choose a preferred team, and interact with fans
  • Prepare an appropriate tag strategy according to users' characteristics. The users in the same chat room, having the same hobbies and at the same age may interact each other

Feature details

Chat room tags are used to set tag-related fields to send and receive messages in a personalized manner at login and when messages are sent. A specific process is detailed as follows:

Login

At login, two parameters may be set:

  • The first parameter "tags" is used to identify which tags the long connection of the login belongs to. It is a json array, and at most 10 tags may be set for a long connection. Each tag consists of 32 characters at most, such as ["abc", "def"]
  • The second parameter notifyTargetTags is a tag expression which indicates the tag users to whom in and out notifications generated by the login and the subsequent logout operation should be broadcast. If missing, the server will automatically generate a tag expression according to tags according to the rule by which all tags are combined by the keyword "and", which means that the users in all tags may receive in and out notifications.

SDK sends messages

A parameter, known as notifyTargetTags, may be set. It is a tag expression, and means the targets to whom the message is sent. If missing, the parameter notifyTargetTags set at login will be used

API sends messages

A parameter, known as notifyTargetTags, may be set. It is a tag expression, which means the targets to whom the message is sent. If missing, the message will be sent to all

Three interfaces (including SDK interface and server API) are added as follows:

  • Mute/unmute a tag user. Only the manager or the chat room creator is allowed to call the interface. After calling, users for which the tag has been set shall not send messages. For example, if tag A is muted, the customers for whom tags ["A","B"] have been set shall not send messages
  • Query the number of online users under a tag. In the event of multi-terminal login for an account, only 1 online user is included
  • Query the list of online members under a tag. It is an interface for paging queries. If a user logs in at multiple terminals, the interface will return several records

Tag expression

Tag expression is used to set the target to which chat room notifications/messages are delivered, and supports the setting of intersection and union, as well as regex match. Brackets may be used to set the priority in the expression (similar as the brackets in addition, subtraction, multiplication and division). Each tag expression consists of up to 128 characters

Examples of some tag expressions:

1) Match tag abc

{"tag": "abc"}

2) Match tag abc or def

{"tag": "abc"} or {"tag": "def"}

3) Match tag abc and def

{"tag": "abc"} and {"tag": "def"}

4) Use regex match tag abc

{"tag": "abc.*", "matchType": "regex"}

5) Match tag abc or def, and regex match tag 123 or 456

({"tag": "abc"} or {"tag": "def"}) and ({"tag": ".*123", "matchType": "regex"} or {"tag": "456.*", "matchType": "regex"})
Was this page helpful?
Yes
No
  • Introduction to features
  • Application scenes
  • Super mini class
  • Large live streaming chat room
  • Feature details
  • Login
  • SDK sends messages
  • API sends messages
  • Add tag-related interfaces
  • Tag expression