Home > Software design >  How to removeMessage from TCHMessages with Twilio
How to removeMessage from TCHMessages with Twilio

Time:06-15

How to use this func in Twilio?

(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