Add the next element
To configure multiple elements, after creating a Message object, you can add the next element via the element object of Message. The following is the sample code for creating V2TIMTextElem and V2TIMCustomElem:
V2TIMMessage *msg = [[V2TIMManager sharedInstance] createTextMessage:"text"];
V2TIMCustomElem *customElem = [[V2TIMCustomElem alloc] init];
customElem.data = ["自定义消息" dataUsingEncoding:NSUTF8StringEncoding];
[msg.textElem appendElem:customElem];
- Attention
- This API can be called only by elements of a Message object created via createMessage.
- This API can be used to add V2TIMTextElem, V2TIMCustomElem, V2TIMFaceElem, or V2TIMLocationElem.