I’m using version 3.0.187 of the SendBirdSDK pod and have been unable to retrieve any messages from a given channel after I post them when I use the new SBDMessageListParams
let listParams = SBDMessageListParams()
listParams.reverse = false
listParams.messageType = .all
listParams.includeThreadInfo = true
channel.getMessagesByTimestamp(timestamp, params: listParams) { (messages, error) in
if (error == nil) {
//Messages always empty array
}
}
Everything appears okay when I send the messages initially (both with and without a parentMessageId), they just aren’t returned when I go to fetch them again:
let params = SBDUserMessageParams(message: message)
if let parentId = parentMessageId {
params?.parentMessageId = parentId
}
var preSendMessage: GMKUserMessage?
preSendMessage = channel.sendUserMessage(with: params) { [weak self] (userMessage, error) in
self?.endTyping()
if error != nil {
self?.markSendFailed(preSendMessage)
} else if let message = userMessage {
//Making it here
self?.markSendSuccessful(preSendMessage, newMessage: message)
}
}
When a parent message Id is present, and I try to fetch the associated threaded messages from the parent using SBDThreadedMessageListParams
, I get the same result. No error and an empty array of messages, even after I have successfully sent child messages:
let listParams = SBDThreadedMessageListParams()
listParams.reverse = false
listParams.messageType = .all
parentMessage.getThreadedMessages(byTimestamp: timestamp, params: listParams) { (parentMessage, messages, error) in
if let messages = messages {
//Messages array always empty, parentMessage returns successfully
}
}