Documentation Index
Fetch the complete documentation index at: https://cometchat-22654f5b-release-ios-chat-uikit-v5-1-2.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
The CustomInteractiveMessage class is used to create an interactive message that can be sent via CometChat. It extends the InteractiveMessage class from CometChat.
Constructor
| Name | Type | Description |
|---|
| receiverId | string | The ID of the receiver |
| receiverType | string | The type of the receiver |
| jsonObject | JSONObject | This parameter takes json object for interactiveData |
Class Usage
How to create an instance of the CustomInteractiveMessage class:
JSONObject jsonObject = new JSONObject();
try {
jsonObject.put("text", "custom Interactive message");
} catch (JSONException e) {
throw new RuntimeException(e);
}
CustomInteractiveMessage customInteractiveMessage = new CustomInteractiveMessage(receiverId,receiverType, jsonObject); //receiverType could be user/group
Send Custom Interactive Message
customInteractiveMessage.setSender(CometChatUIKit.getLoggedInUser());
customInteractiveMessage.setReceiver(user); // set Receiver user/group object
CometChatUIKit.sendCustomInteractiveMessage(customInteractiveMessage, false, new CometChat.CallbackListener<CustomInteractiveMessage>() {
@Override
public void onSuccess(CustomInteractiveMessage customInteractiveMessage) {
}
@Override
public void onError(CometChatException e) {
e.printStackTrace();
}
});