You start with a
<Chat /> component that will render a chat screen. It has 3 required props:
messages- an array of messages to be rendered. Accepts any message, see types. If you have your message types you will need to map those to any of the defined ones. Let us know if we need to add more message types or add more fields to the existing ones.
onSendPress- a function that will have a partial text message as a parameter. See types for more info on how types are structured. From the partial text message you need to create a text message which will at least have
type: 'text', this is done by you because we wanted to give you more control over those values.
user- a User object, that has only one required field - an
id, used to determine the message author.
Below you will find a drop-in example of the chat with only text messages.
Try to write any URL, for example, https://flyer.chat, it should be unwrapped in a rich preview.
All examples are in TypeScript.