Is there a way to handle press action on mentions with react native getstream sdk

125 Views Asked by At

Hi there problem solvers :)

I am trying to redirect to the user profile that has been mentioned on message bubble, on mention press.

I explored the getstream docs for react native but did not find anything related to this issue.

1

There are 1 best solutions below

4
Vishal Narkhede On BEST ANSWER

You can do it as following:

<Channel
  channel={channel}
  onPressMessage={({ message, emitter, additionalInfo }) => {
    if (emitter === 'textMention') {
      // custom implementation navigating to user profile
      // additionalInfo.user corresponds to mentioned user object, which is pressed
      goToUserProfile(additionalInfo.user.id);
    }
  })}
>
  <MessageList />
  <MessageInput />
</Channel>