融云会话里添加附加信息

融云版本2.3.6
在会话界面重写方法:
- (RCMessageContent )willSendMessage:(RCMessageContent )messageCotent{
if ([messageCotent isKindOfClass:[RCTextMessage class]]) {

    RCTextMessage *textMessage = (RCTextMessage*)messageCotent;

    textMessage.extra = @"附加信息";

    return textMessage;

}else if([messageCotent isKindOfClass:[RCImageMessage class]]){
    RCImageMessage *imageMessage = (RCImageMessage *)messageCotent;
    imageMessage.extra = @"附加信息";

}else if ([messageCotent isKindOfClass:[RCVoiceMessage class]]){
    RCVoiceMessage *voiceMessage = (RCVoiceMessage *)messageCotent;
    voiceMessage.extra = @"附加信息";
}

 return messageCotent;

}

在会话界面可以接收到附加的信息:
for (RCMessageModel *model in self.conversationDataRepository) {
if ([model.content isKindOfClass: [RCTextMessage class] ]) {

        RCTextMessage *textMessage = (RCTextMessage *)model.content;

        NSLog(@"textMessage.extra==%@",textMessage.extra);

    }
}
阅读更多
版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/u010112623/article/details/49923959
个人分类: iOS开发_开发工具
上一篇ios 剪裁图片
下一篇iOS设置同一个Label的不同颜色的字体
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

关闭
关闭