tencent cloud

Feedback

Last updated: 2023-08-23 16:51:06
    This document describe how to implement sticker module in Tencent Cloud Chat Flutter UIKIt.

    

    Three types of sticker, or emoji, are available in TIMUIKitChat widget, shows in the following list:
    Sticker Type
    MessageType
    Integrate within Text
    Sending Scheme
    Rending Scheme
    Usage
    Default
    Unicode Emoji
    Text Message
    Yes
    Unicode
    The device automatically parses Unicode characters into emojis. The parsing result of the same Unicode characters may vary with devices.
    Enabled as default, with a set of default Unicode emoji list, while customization is also support.
    A set of default Unicode emoji list is provided.
    Small image
    Text Message
    Yes
    Image name
    The image is automatically matched against the local image assets by name.
    Enabled as default , with two sets of default packages, while adding new packages and cutmization are also support.
    Two sets of default packages are provided, shown as the screenshots below.
    Large image
    Sticker Message
    No
    baseURL plus the image file name, which form the path of the emoji image asset
    The asset resources are parsed based on the path.
    Images are stored as assets, and are defined in List
    -
    具体效果如下:
    Name
    Small Image
    (Designed by us)
    Small Image (The same with QQ)
    Emoji Unicode
    Tencent Large Image
    Type
    Small image
    Unicode Emoji
    Large image
    Description
    Enabled as default
    located at first
    Enabled as default located at second
    Enabled as default located at third
    with a customizable default list
    Not provided as default, this packages comes from customize configuration from our Sample App.
    Screenshots
    Figure 1
    Figure 1
    
    Figure 2
    Figure 2
    
    Figure 3
    Figure 3
    
    Figure 4
    Figure 4
    

    Configuration Guide

    Use Default Configuration

    After entering the UIKit conversation chat page, the left three groups of emoji packages in the upper table will be default enabled, no additional configuration is required.

    Custom Configuration

    The emoji capability custom configuration is all done using the stickerPanelConfig parameter in TIMUIKitChatConfig. This parameter requires passing in the StickerPanelConfig class for specified configuration.
    TIMUIKitChat(
    config: TIMUIKitChatConfig(
    stickerPanelConfig: StickerPanelConfig(
    useQQStickerPackage: true, // Whether to enable QQ image small emoji package, enabled by default
    useTencentCloudChatStickerPackage: true,// Whether to enable our own designed image small emoji package, enabled by default
    unicodeEmojiList: [], // Unicode Emoji list, a default set is provided, passing an empty array will disable this emoji package
    customStickerPackages: [] // Expand more Custom emoji packages
    ),
    )

    Default Small Image Sticker packages

    Default Image Small Sticker Package, including two sets: Our Own Design and QQ Style. These two sets of sticker packages do not require additional configuration and are enabled by default.
    If you do not need to use them, you can set StickerPanelConfig's useQQStickerPackage (QQ Style) or useTencentCloudChatStickerPackage (Our Own Design) to false.
    Note:
    The effect of this set of sticker packages is shown in the screenshot examples above, as shown in Figure 1 and Figure 2.

    Unicode Emoji

    We provide a default set of Unicode Emoji List, which does not require additional configuration and is enabled by default.
    If you do not need to use it, you can pass an empty array in StickerPanelConfig's unicodeEmojiList.
    If you need to customize the Unicode Emoji Package, please specify your Unicode Emoji list in the form of List<int>.
    Note:
    The effect of this set of packages is shown in the screenshot examples above, as shown in Figure 3.

    Import and Use Custom Sticker Package

    Please import your sticker resource files into the assets/custom_face_resource/ directory of your project. Whether it is large image emoticons or small image stickers, they need to be imported according to this step.
    In this directory, please use different folders to distinguish different tabs in the sticker panel. Each tab only supports one type of sticker, either large image stickers or small image stickers.
    Please name the folder with the name of the tab. This naming will not be displayed to users, so you can customize it according to your development needs.
    Please ensure that all sticker resource files have no duplicate names.
    
    
    
    After importing the project, please pass in your sticker package list as List<CustomStickerPackage> to StickerPanelConfig's customStickerPackages.

    More Usage

    Using with text message Markdown parsing mode

    If you use both the small image sticker packages (including the default provided and your custom ones) and the text message Markdown parsing ability, you need to manually import our sticker pack resources into the assets/custom_face_resource/ directory of your project.
    In this directory, please place these two folders, 4349 and tcc1.
    
    Contact Us

    Contact our sales team or business advisors to help your business.

    Technical Support

    Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

    7x24 Phone Support