Before you begin
Create an Iframely account
Sign up with Iframely.
Extension settings
Open your CometChat app
Login to CometChat and select your app.
Enable Rich Media Preview
Go to Chat & Messaging —> Features, under Extentions and enable Rich Media Preview.
How does it work?
If the text message contains a URL, the extension will create a Preview using your iFramely credentials. These details can then be used to show a nice preview card for that URL.The preview metadata is updated after the message is sent, so you should implement the
onMessageEdited listener. See Edit message in the SDK docs.- JSON
Choose Your Integration Method
Choose the integration method that best suits your needs:UI Kit Builder
- Enable it in both Dashboard and UI Kit Builder settings, then you can use the Rich Media Preview extension in your custom chat experience.
Widget Builder
- Enable it in both Dashboard and Widget Builder settings, then you can use the Rich Media Preview extension in your custom chat widget.
UI Kits
- Enable it in the Dashboard settings, then you can use the Rich Media Preview extension in your custom chat experience built with our UI Kits.
SDK
- Enable it in the Dashboard settings, then you can use the Rich Media Preview extension in your custom chat experience built with our SDK.
Code
At the recipients’ end, from the message object, you can fetch the metadata by calling the getMetadata() method. Using this metadata, you can fetch the Rich Media Embed.- JavaScript
- Java
- Kotlin
- Swift