Conversation Drafts
Save Draft
You can use saveTextMessageDraft:targetId:content:completion: to save a draft message to a specified conversation. Saving a draft will update the conversation's sentTime and operationTime (a new property added in version 5.6.8), causing the conversation to appear at the top of the list.
Method Signature
- (void)saveTextMessageDraft:(RCConversationType)conversationType
targetId:(NSString *)targetId
content:(NSString *)content
completion:(nullable void(^)(BOOL ret))completion;
Parameters
| Parameter | Type | Description |
|---|---|---|
| conversationType | RCConversationType | Conversation type |
| targetId | NSString | Target ID of the conversation |
| content | NSString | Draft content |
| completion | Block | Callback for operation result |
Example
[[RCCoreClient sharedCoreClient] saveTextMessageDraft:ConversationType_PRIVATE
targetId:@"targetId"
content:@"This is draft content"
completion:^(BOOL success) {
}];
Retrieve Draft
You can use getTextMessageDraft:targetId:completion: to retrieve draft content.
Method Signature
- (void)getTextMessageDraft:(RCConversationType)conversationType
targetId:(NSString *)targetId
completion:(nullable void(^)(NSString * _Nullable draft))completion;
Parameters
| Parameter | Type | Description |
|---|---|---|
| conversationType | RCConversationType | Conversation type |
| targetId | NSString | Target ID of the conversation |
| completion | Block | Callback for operation result |
Example Code
[[RCCoreClient sharedCoreClient] getTextMessageDraft:ConversationType_PRIVATE
targetId:@"targetId"
completion:^(NSString *draft) {
}];
Delete Draft
You can use clearTextMessageDraft:targetId:completion: to delete a draft.
Method Signature
- (void)clearTextMessageDraft:(RCConversationType)conversationType
targetId:(NSString *)targetId
completion:(nullable void(^)(BOOL ret))completion;
Parameters
| Parameter | Type | Description |
|---|---|---|
| conversationType | RCConversationType | Conversation type |
| targetId | NSString | Target ID of the conversation |
| completion | Block | Callback for operation result |
Example Code
[[RCCoreClient sharedCoreClient] clearTextMessageDraft:ConversationType_PRIVATE
targetId:@"targetId"
completion:^(BOOL success) {
}];