Skip to content
v1
文档/iOS SDK/消息

创建 FACE 自定义表情消息

FACE 消息只传递表情标识和尺寸,不上传图片。发送方与接收方需要用相同的 themeName + stickerName 将消息映射到应用内资源。

接口

objc
- (BIMFaceMessage *)createFaceMessageWithName:(NSString * _Nullable)name
                                    themeName:(NSString *)themeName
                                  stickerName:(NSString *)stickerName
                                        width:(int64_t)width
                                       height:(int64_t)height
                                        isGif:(BOOL)isGif;
参数说明
name展示名,可为空
themeName表情包主题,如 default
stickerName主题内唯一资源名,如 01
width / height原始像素尺寸,用于预估气泡布局
isGif是否为 GIF 动图

示例

objc
BIMFaceMessage *message = [[BIMManager sharedInstance]
    createFaceMessageWithName:@"01"
                    themeName:@"default"
                  stickerName:@"01"
                        width:240
                       height:240
                        isGif:NO];
swift
let message = BIMManager.sharedInstance().createFaceMessage(
    withName: "01",
    themeName: "default",
    stickerName: "01",
    width: 240,
    height: 240,
    isGif: false
)

创建后使用统一的 sendMessage 接口发送。FACE 消息没有 mediaId,SDK 不负责表情图片的资源下载;接入方应内置资源或维护自己的表情包下载与缓存逻辑。收到消息后通过 BIMFaceMessage 的同名属性渲染。