Reply Comment
The iOS Feed SDK offers the ability to reply to comments, enabling users to engage in threaded discussions within the application. By leveraging this feature, users can respond directly to specific comments, facilitating more focused conversations and enhancing the overall interactivity and depth of discussions on the platform.
Steps to reply on a comment
- Create a ReplyCommentRequest object using
ReplyCommentRequest.builder()
class by passing all the required parameters. - Call
replyComment()
function using the instance ofLMFeedClient
. - Process the response LMResponse<ReplyCommentResponse> as per your requirement.
// object of ReplyCommentRequest
let request = ReplyCommentRequest.builder()
.postId(ENTER_POST_ID) // post id of the liked comment
.commentId(ENTER_COMMENT_ID) // id of the comment liked
.text("Reply text") // reply text
.tempId(ENTER_TEMP_ID) // temporary id of the comment
.build()
LMFeedClient.shared.replyComment(request) { response in
// response (LMResponse<ReplyCommentResponse>)
if (response.success) {
// your function to process the response data
processResponse(response.data)
} else {
// your function to process error message
processError(response.errorMessage)
}
}
Models
ReplyCommentRequest
VARIABLE | TYPE | DESCRIPTION | OPTIONAL |
---|---|---|---|
postId | String | ID of the post on which member has replied | |
commentId | String | ID of the comment on which member has replied | |
text | String | Text content of the reply | |
tempId | String | Temporary ID for Comment |
ReplyCommentResponse
VARIABLE | TYPE | DESCRIPTION | OPTIONAL |
---|---|---|---|
comment | Comment | Object of the added reply. | |
users | [String: User] | Dictionary of user unique id to user object. |