[Question]
I am working with the SendBird Android SDK, and my use case involves sending messages in a group channel. If the recipient has blocked me, the messages are not delivered to the channel, which aligns with the documentation:
“Even though messages sent from the blocked user aren’t delivered to the channel, they are saved in the database and are only displayed in the blocked user’s channel view. This means that the blocked user isn’t aware of their blocked status”
My question is: since these messages are saved in the database, how can I retrieve them when fetching all the messages for the group channel?
I am using below code to retrieve messages in a channel, but these undelivered messages are not being retrieved with this
messageCollection?.initialize(
MessageCollectionInitPolicy.CACHE_AND_REPLACE_BY_API,
object : MessageCollectionInitHandler {
private var shouldSendErrorOnApiFail = true
override fun onApiResult(apiResultList: List<BaseMessage>?, e: SendbirdException?) {
if (e != null) {
}
val messagesList = mutableListOf<ChatBaseMessage>()
apiResultList?.map { baseMessage ->
val chatMessage: ChatBaseMessage? =
chatMapper.mapToChatMessage(baseMessage)
chatMessage?.let { messagesList.add(it) }
}
}
override fun onCacheResult(cachedList: List<BaseMessage>?, e: SendbirdException?) {
}
}
)