美文网首页
iOS ---融云即时通讯---会话界面

iOS ---融云即时通讯---会话界面

作者: iOS程序媛ing | 来源:发表于2020-11-24 13:53 被阅读0次

融云提供了封装好的聊天界面,RCConversationViewController
创建方式如下

//conversationType会话类型。代表是单聊、群聊、还是聊天室等,传入对应的type即可
//targetId. 目标会话ID。 如果是单聊,targetId代表对方的用户id;如果是群聊targetId代表群id
- (id)initWithConversationType:(RCConversationType)conversationType targetId:(NSString *)targetId;

(一)底部控制板

截屏2020-11-23 下午4.35.35.png
  • SDK 支持添加、修改、删除扩展板上的每一个扩展项,包括- 修改扩展项的图片、文案以及点击之后的响应事件处理。
  • 默认情况下,扩展板包含相机、相册、定位按钮。如果开通音视频通话,系统会自动添加音频通话、视频通话按钮。

属性chatSessionInputBarControl,就是会面界面的控制面板

@property (nonatomic, strong) RCChatSessionInputBarControl *chatSessionInputBarControl;

RCPluginBoardView是控制面板扩展项的view

@property (nonatomic, strong) RCPluginBoardView *pluginBoardView;

(1)如果我们需要更改按钮的图片、文字可以调用如下方法修改

- (void)updateItemAtIndex:(NSInteger)index image:(UIImage *)image title:(NSString *)title;
  • 更改扩展项图片、文字
 [self.chatSessionInputBarControl.pluginBoardView updateItemAtIndex:0 image:[UIImage imageNamed:@"客服聊天-照片"] title:@"照片"];
  • 删除原有扩展项(根据下标删除)
[self.chatSessionInputBarControl.pluginBoardView removeItemAtIndex:2];
  • 新增扩展项
 [self.chatSessionInputBarControl.pluginBoardView insertItemWithImage:[UIImage imageNamed:@"客服聊天-订单"] title:@"订单" atIndex:2 tag:100 + 2];

(2)扩展功能板的点击回调

- (void)pluginBoardView:(RCPluginBoardView *)pluginBoardView clickedItemWithTag:(NSInteger)tag 

(二)自定义消息

融云自定义消息

相关文章

网友评论

      本文标题:iOS ---融云即时通讯---会话界面

      本文链接:https://www.haomeiwen.com/subject/zxqliktx.html