Extension settings
- Login to CometChat and select your app.
- Navigate to Chat & Messaging → Features and enable Pin Message under Extensions.
How does it work?
Pin message extension provides you the ability to:- Pin messages
- Unpin messages
- Fetch all the pinned messages for a conversation.
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