Preset Switches
Global IM UIKit provides a set of preset switches to control the enabling and disabling of certain features. These switches can be accessed via the RCKitCommand
enumeration.
Preset Switches List
Preset Switch | Default | Description |
---|---|---|
RCKitCommand.SHOW_CONNECTION_STATUS | true | Whether to display connection status change reminders in the opened conversation window |
RCKitCommand.SHOW_MESSAGE_STATE | true | Whether to display the read status of messages; When disabled, only the sending status of messages will be shown in the message bubble |
RCKitCommand.FOCUS_ON_LATEST_MESSAGE | true | How to display the message list when entering a conversation, only supported on Electron platform:true : Scroll to the bottom to show the latest messagefalse : Display the last read position |
RCKitCommand.AT_ALL | true | Whether to support the @all function in group chats |
RCKitCommand.SHOW_USER_ONLINE_STATE | false | Whether to display user online status, which requires the reqUserOnlineStatus hook defined during initialization to take effect. |
RCKitCommand.PROMPT_SENDER_WHEN_QUOTE_MESSAGE | true | Whether to @ the message sender by default when quoting or replying to a message |
RCKitCommand.DELETE_MESSAGES_WHILE_DELETE_CONVERSSATION | true | Whether to delete messages stored locally and on the remote server when deleting a conversation |
Modifying Switch States
Switch state modifications only take effect if made before kitApp.ready()
is called; otherwise, they will not be applied.
For example, to modify the state of the RCKitCommand.SHOW_CONNECTION_STATUS
switch, use the following code:
import { RCKitCommand } from '@rongcloud/global-im-uikit';
kitApp.setCommand(RCKitCommand.SHOW_CONNECTION_STATUS, false);
Retrieving Switch States
import { RCKitCommand } from '@rongcloud/global-im-uikit';
const bool = kitApp.getCommandSwitch(RCKitCommand.SHOW_CONNECTION_STATUS);