ChatLifeCycle

Introduction

The life cycle for chat business logic.

Parameter introduction

newMessageWillMount

  • Parameter type : Future< V2TimMessage? > Function( V2TimMessage message)

  • Supported Platform: All

  • Parameter description : Before a new message will be added to historical message list from long connection. You may not render this message by return null.

modifiedMessageWillMount

  • Parameter type : Future< V2TimMessage? > Function( V2TimMessage message)

  • Supported Platform: All

  • Parameter description : Before a modified message updated to historical message list UI.

messageWillSend

  • Parameter type : Future< V2TimMessage? > Function( V2TimMessage message)

  • Supported Platform: All

  • Parameter description : Before a new message will be sent. Returns null can block the message from sending.

didGetHistoricalMessageList

  • Parameter type : Future< List< V2TimMessage > > Function( List< V2TimMessage > messageList)

  • Supported Platform: All

  • Parameter description : After getting the latest message list from API, and before historical message list will be rendered. You may add or delete some messages here.

shouldDeleteMessage

  • Parameter type : Future< bool > Function(String msgID)

  • Supported Platform: All

  • Parameter description : Before deleting a message from historical message list, true means can delete continually, while false will not delete. You can make a second confirmation here by a modal, etc.

shouldClearHistoricalMessageList

  • Parameter type : Future< bool > Function(String msgID)

  • Supported Platform: All

  • Parameter description : Before clearing the historical message list, true means can clear continually, while false will not clear. You can make a second confirmation here by a modal, etc.

results matching ""

    No results matching ""