更新时间: 2021-03-08
# 输入框相关
# 内容发生变化
参数说明:
参数 | 类型 | 说明 |
---|---|---|
inputTextView | NSIndexPath | 文本输入框 |
range | NSRange | 当前操作的范围 |
text | NSString | 插入的文本 |
回调原型:
- (void)inputTextView:(UITextView *)inputTextView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text;
已复制
1
# 高度发生变化
参数说明:
参数 | 类型 | 说明 |
---|---|---|
chatInputBar | RCChatSessionInputBarControl | 输入工具栏 |
frame | CGRect | 输入工具栏最终需要显示的Frame |
回调原型:
- (void)chatInputBar:(RCChatSessionInputBarControl *)chatInputBar shouldChangeFrame:(CGRect)frame;
已复制
1
如重写此方法,请先调用父类方法。
# 消息操作相关
# 准备发送消息
此回调在消息准备向外发送时会回调,可以在此回调中对消息内容进行过滤和修改等操作。此回调的返回值不为 nil 时,SDK 会对外发送返回的消息内容。
参数说明:
参数 | 类型 | 说明 |
---|---|---|
messageContent | RCMessageContent (opens new window) | 消息内容 |
返回参数说明
参数 | 类型 | 说明 |
---|---|---|
messageContent | RCMessageContent (opens new window) | 修改后的消息内容 |
回调原型:
- (RCMessageContent *)willSendMessage:(RCMessageContent *)messageContent;
已复制
1
# 发送消息完成
参数说明:
参数 | 类型 | 说明 |
---|---|---|
status | NSInteger | 发送状态,0表示成功,非0表示失败 |
messageContent | RCMessageContent (opens new window) | 消息内容 |
回调原型:
- (void)didSendMessage:(NSInteger)status content:(RCMessageContent *)messageContent;
已复制
1
# 取消消息发送
参数说明:
参数 | 类型 | 说明 |
---|---|---|
messageContent | RCMessageContent (opens new window) | 消息内容 |
回调原型:
- (void)didCancelMessage:(RCMessageContent *)messageContent;
已复制
1
# 即将插入消息
此回调在消息准备向外发送时会回调,可以在此回调中对消息内容进行过滤和修改等操作。此回调的返回值不为 nil 时,SDK 会对外发送返回的消息内容。
参数说明:
参数 | 类型 | 说明 |
---|---|---|
messageContent | RCMessageContent (opens new window) | 消息内容 |
返回参数说明
参数 | 类型 | 说明 |
---|---|---|
messageContent | RCMessageContent (opens new window) | 修改后的消息内容 |
回调原型:
- (RCMessage *)willAppendAndDisplayMessage:(RCMessage *)message;
已复制
1
# Cell 显示
# 即将显示消息 Cell
参数说明:
参数 | 类型 | 说明 |
---|---|---|
cell | RCMessageBaseCell (opens new window) | 消息Cell |
indexPath | NSIndexPath | 该Cell对应的消息Cell数据模型在数据源中的索引值 |
回调原型:
- (void)willDisplayMessageCell:(RCMessageBaseCell *)cell atIndexPath:(NSIndexPath *)indexPath;
已复制
1
# 未注册消息相关
# 显示内容
参数 | 类型 | 说明 |
---|---|---|
collectionView | UICollectionView | 当前CollectionView |
indexPath | NSIndexPath | 该Cell对应的消息Cell数据模型在数据源中的索引值 |
返回参数说明
类型 | 说明 |
---|---|
RCMessageBaseCell (opens new window) | 未注册消息需要显示的Cell |
回调原型:
- (RCMessageBaseCell *)rcUnkownConversationCollectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath;
已复制
1
2
2
# 显示高度
参数 | 类型 | 说明 |
---|---|---|
collectionView | UICollectionView | 当前CollectionView |
collectionViewLayout | UICollectionViewLayout | 当前CollectionView Layout |
indexPath | NSIndexPath | 该Cell对应的消息Cell数据模型在数据源中的索引值 |
返回参数说明
类型 | 说明 |
---|---|
CGSize | 未注册消息Cell需要显示的高度 |
回调原型:
- (CGSize)rcUnkownConversationCollectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath;
已复制
1
2
3
2
3
# Cell 点击事件
# 点击头像
参数说明:
参数 | 类型 | 说明 |
---|---|---|
userId | NSString | 点击头像对应的用户ID |
回调原型:
- (void)didTapCellPortrait:(NSString *)userId;
已复制
1
# 长按头像
参数说明:
参数 | 类型 | 说明 |
---|---|---|
userId | NSString | 点击头像对应的用户ID |
回调原型:
- (void)didLongPressCellPortrait:(NSString *)userId;
已复制
1
# 点击消息内容
参数说明:
参数 | 类型 | 说明 |
---|---|---|
model | RCMessageModel (opens new window) | 消息Cell的数据模型 |
回调原型:
- (void)didTapMessageCell:(RCMessageModel *)model;
已复制
1
重写此回调时,如果想保留SDK原有的功能,需要注意调用super。
# 长按消息内容
参数说明:
参数 | 类型 | 说明 |
---|---|---|
model | RCMessageModel (opens new window) | 消息Cell的数据模型 |
view | UIView | 长按区域的View |
回调原型:
- (void)didLongTouchMessageCell:(RCMessageModel *)model inView:(UIView *)view;
已复制
1
重写此回调时,如果想保留SDK原有的功能,需要注意调用super。
# 点击 URL
参数说明:
参数 | 类型 | 说明 |
---|---|---|
model | RCMessageModel (opens new window) | 消息Cell的数据模型 |
url | NSString | 点击的URL |
回调原型:
- (void)didTapUrlInMessageCell:(NSString *)url model:(RCMessageModel *)model;
已复制
1
重写此回调时,如果想保留SDK原有的功能,需要注意调用super。
# 点击电话号码
参数说明:
参数 | 类型 | 说明 |
---|---|---|
model | RCMessageModel (opens new window) | 点击的电话号码 |
phoneNumber | NSString | 消息Cell的数据模型 |
回调原型:
- (void)didTapPhoneNumberInMessageCell:(NSString *)phoneNumber model:(RCMessageModel *)model;
已复制
1
# 获取长按时的菜单
参数说明:
参数 | 类型 | 说明 |
---|---|---|
model | RCMessageModel (opens new window) | 消息Cell的数据模型 |
返回参数说明
类型 | 说明 |
---|---|
NSArray <UIMenuItem *> | 未注册消息Cell需要显示的高度 |
回调原型:
- (NSArray<UIMenuItem *> *)getLongTouchMessageCellMenuList:(RCMessageModel *)model;
已复制
1
重写此回调时,如果想保留SDK原有的功能,需要注意调用super。
# 语音相关
# 开始录制
回调原型:
- (void)onBeginRecordEvent;
已复制
1
# 结束录制
回调原型:
- (void)onEndRecordEvent;
已复制
1
# 取消录制
回调原型:
- (void)onCancelRecordEvent;
已复制
1