[Problem/Question]
Is it possible to cancel/delete a pending text message?
When there is no internet connection, a message will be in SendingStatus.PENDING state. However, calling channel.deleteMessage(message, handler)
will return an error exception saying there’s no internet connection. Just wondering is there a way to cancel or delete this pending message while offline? I’m not even sure if deleteMessage works for pending messages while there is internet, as it moves from PENDING to SUCCEEDED too quickly before I can try it.
Going through the Android SDK documentation, seems like we can cancel a pending FileMessage using channel.cancelFileMessageUpload(fileMessage.requestId)
, but there’s nothing like channel.cancelMessage()
?
The reason we need this is, the user could have a bad internet connection for several hours, and the message they meant to send earlier might not be relevant anymore, but they have no choice but to send it as soon as internet connection is back online. We want to allow the user to delete any messages that has not been sent yet. As for why we could not use deleteMessage
after it is sent, that’s because our app needs to retain the chat history and we disallow user from deleting or editing a message after they have been sent successfully, hope that makes sense.
Thanks,
Bruce