How to Handle Link Taps in Conversation Message View #93
damon-v2
announced in
Conversation
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Versions
Summary
This guide explains how to customize the behavior when a user taps a link inside a message in the conversation view.
Guide & Snippet
iOS
Customizing Link Tap Action in Message
SBAConversationViewControllerand handling the.didTapMessageLinkevent.Step 1: Subclass
SBAConversationViewControllerStep 2: Register the Custom Controller
SBAViewControllerSet.ConversationViewControllerbefore presenting the messenger.Android
Steps to Handle Link Taps
Step 1: Create a Custom ConversationMessageListAdapter
Extend ConversationMessageListAdapter and override the onMarkdownLinkClickListener to implement your own logic.
Step 2: Register the Custom Adapter with AIAgentAdapterProviders
You must register your custom adapter before launching the messenger UI:
React
How to handle link clicks in conversation messages
Currently, links in messages automatically open in a new tab with
target="_blank". To customize link behavior, you need to create a customMessageBodycomponent that handles link clicks.Step 1: Create a Custom MessageBody with Link Handler
Step 2: Register the Custom Component
Notes:
target="_blank"andrel="noopener noreferrer"MessageBodycomponent<a>tagsReference
No response
Screenshots
No response
Beta Was this translation helpful? Give feedback.
All reactions