getConversationBuilder
A factory function used to retrieve a ConversationBuilder
object
based on the conversationId
given.
The ConversationBuilder
object encapsulates a conversation
between 2 or more participants. Use the methods, setParticipant
and setAttributes
on the returned object to
further set up your conversation.
1getConversationBuilder(conversationId: string): ConversationBuilder
Name | Type | Description |
---|---|---|
conversationId Required | string | The conversation ID |
1import * as TalkRn from '@talkjs/react-native';23const me: TalkRn.User = {4 id: '123456789',5 name: 'Alice',7 photoUrl: 'https://talkjs.com/images/avatar-1.jpg',8 welcomeMessage: 'Hey there! How are you? :-)',9};1011const other: TalkRn.User = {12 id: '432156789',13 name: 'Sebastian',15 photoUrl: 'https://talkjs.com/images/avatar-5.jpg',16 welcomeMessage: 'Hey, how can I help? https://google.com',17};1819const conversationId = TalkRn.oneOnOneId(me.id, other.id);20const conversationBuilder = TalkRn.getConversationBuilder(conversationId);2122conversationBuilder.setParticipant(me);23conversationBuilder.setParticipant(other, { notify: false });2425conversationBuilder.setAttributes({ subject: 'Random conversation' });