Home > front end >  How to removeMessage from TCHMessages means Twilio in swift
How to removeMessage from TCHMessages means Twilio in swift

Time:06-14

How use this func (void)removeMessage:(nonnull TCHMessage *)message completion:(nullable TCHCompletion)completion;

CodePudding user response:

First of all, fetch all old messages using getLastMessages which will return you [TCHMessage]. Then, select the particular TCHMessage object which you want to remove. Finally,

//For TwilioChatClient
channel.messages?.remove(message, completion: { result in
      print(result)  
})

//For TwilioConversationsClient
channel.remove(message) { result in
    print(result)
}
  • Related