Extension settings
Open your CometChat app
Login to CometChat and select your app.
How does it work?
Pin message extension provides you the ability to:- Pin messages: Keep important messages visible in a conversation.
- Unpin messages: Remove pinned messages when they are no longer relevant.
- Fetch pinned messages: Retrieve all pinned messages for a conversation.
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 Pin Message extension in your custom chat experience.
Widget Builder
- Enable it in both Dashboard and Widget Builder settings, then you can use the Pin Message extension in your custom chat widget.
UI Kits
- Enable it in the Dashboard settings, then you can use the Pin Message extension in your custom chat experience built with our UI Kits.
SDK
- Enable it in the Dashboard settings, then you can use the Pin Message extension in your custom chat experience built with our SDK.
Code
1. Pin a message
To pin a message, use thecallExtension method provided by the SDK to make an HTTP POST request with the parameters as shown below. You need to pass the msgId that has to be pinned.
- JavaScript
- Java
- Swift
2. Unpin a message
To unpin a message, use thecallExtension method provided by the SDK to make an HTTP DELETE request with the parameters as shown below. You need to pass the msgId, receiverType and the receiver (can be either UID or GUID based on receiverType).
- JavaScript
- Java
- Swift
3. Fetch pinned messages
To fetch the pinned messages for a conversation, use thecallExtension method provided by the SDK to make an HTTP GET request with the query parameters as shown below. You need to pass the receiverType and the receiver (can be either UID or GUID based on receiverType).
- JavaScript
- Java
- Swift