Send a Message
Text message#
Text is a basic form of communication between users. sdk provides methods to send the text message to the end users. once the user has sent message via sdk, it will give callback with status. if you want send the text message for a user, you can utilise the below method.
To send your text message, you need to pass the TextMessage object as an argument to the parameter in the sendTextMessage() method.
- Java
- Kotlin
| Argument | Type | Description |
|---|---|---|
| MESSAGE_PARAMS | TextMessage | Object to hold the parameters of the text message |
| CALLBACK | SendMessageCallback | callback to observe the action status |
Image message#
To send image as a message call the below method. Calling the below method will upload the image file to the server provided during sdk initialization then send the message
To send your image message, you need to pass the FileMessage object as an argument to the parameter in the sendMediaFileMessage() method.
- Java
- Kotlin
| Argument | Type | Description |
|---|---|---|
| MESSAGE_PARAMS | FileMessage | Object to hold the parameters of the image message |
| CALLBACK | SendMessageCallback | callback to observe the action status |
Note : In ChatManager
.setMediaFolderNameshould be defined to set your own local path to store app media files.
caution
If Image attachment feature unavailable for your plan then it will throw 403 exception.
caution
FlyMessenger.sendFileMessage() method was deprecated and will be removed in the future release. migrate to FlyMessenger.sendMediaFileMessage() method to send Image files.
Image Message with Custom Compression Quality#
To compress a file with a manually specified quality, use MediaUtils.compressImageFile(). Once the compression is successful, the resulting compressedFilePath can be assigned to the file field of FileMessage (e.g., fileMessageParams.setFile(new File(compressedFilePath))). Finally, send the image using FlyMessenger.sendMediaMessage(fileMessageParams).
| Argument | Type | Description |
|---|---|---|
| inputPath | String | The absolute path of the image file to be compressed. |
| mediaCompressQuality | MediaCompressionQaulity | Compression quality level (e.g., low, medium, high, uncompressed). |
| context | ContextWrapper | Android context wrapper required for internal file operations. |
| callback | CompressCallback | Callback interface to receive the result of the compression (success or failure). |
To send a compressed image file, use the method shown below:
Image message with url#
To send image as a message call the below method. You can upload the image file to your storage of choice and send the url and other necessary info while sending the message.
To send your image message, you need to pass the FileMessage object as an argument to the parameter in the sendMediaFileMessage() method.
- Java
- Kotlin
| Argument | Type | Description |
|---|---|---|
| MESSAGE_PARAMS | FileMessage | Object to hold the parameters of the image message |
| CALLBACK | SendMessageCallback | callback to observe the action status |
caution
If Image attachment feature unavailable for your plan then it will throw 403 exception.
caution
FlyMessenger.sendFileMessage() method was deprecated and will be removed in the future release. migrate to FlyMessenger.sendMediaFileMessage() method to send Image files.
Video message#
Video sharing is very useful communication between users. sdk provides methods to send the video message to the end users. once the user has sent message via sdk, it will give callback with status. if you want send the video message for a user, you can utilise the below method.
To send your video message, you need to pass the FileMessage object as an argument to the parameter in the sendMediaFileMessage() method.
- Java
- Kotlin
| Argument | Type | Description |
|---|---|---|
| MESSAGE_PARAMS | FileMessage | Object to hold the parameters of the video message |
| CALLBACK | SendMessageCallback | callback to observe the action status |
Note : In ChatManager
.setMediaFolderNameshould be defined to set your own local path to store app media files.
caution
If Video attachment feature unavailable for your plan then it will throw 403 exception.
caution
FlyMessenger.sendFileMessage() method was deprecated and will be removed in the future release. migrate to FlyMessenger.sendMediaFileMessage() method to send Video files.
Video Message with Custom Compression Quality#
To compress a video file with a manually specified quality, use MediaUtils.compressVideoFile(). Once the compression is successful, the resulting compressedFilePath can be assigned to the file field of FileMessage (e.g., fileMessageParams.setFile(new File(compressedFilePath))). Finally, send the video file using FlyMessenger.sendMediaMessage(fileMessageParams).
| Argument | Type | Description |
|---|---|---|
| inputPath | String | The absolute path of the video file to be compressed. |
| mediaCompressQuality | MediaCompressionQaulity | Compression quality level (e.g., low, medium, high, uncompressed). |
| context | ContextWrapper | Android context wrapper required for internal file operations. |
| callback | CompressCallback | Callback interface to receive the result of the compression (success or failure). |
To send a compressed video file, use the method shown below:
Video message with url#
If you have uploaded the video to your own media server and the you want to share video with other user. sdk provides methods to send the video message to the end users. once the user has sent message via sdk, it will give callback with status. if you want send the video message for a user, you can utilise the below method.
To send your video message, you need to pass the FileMessage object as an argument to the parameter in the sendMediaFileMessage() method.
- Java
- Kotlin
| Argument | Type | Description |
|---|---|---|
| MESSAGE_PARAMS | FileMessage | Object to hold the parameters of the video message |
| CALLBACK | SendMessageCallback | callback to observe the action status |
caution
If Video attachment feature unavailable for your plan then it will throw 403 exception.
caution
FlyMessenger.sendFileMessage() method was deprecated and will be removed in the future release. migrate to FlyMessenger.sendMediaFileMessage() method to send Video files.
Audio message#
To send audio as a message call the below method. Calling the below method will upload the audio file to the server provided during sdk initialization then send the message
To send your audio message, you need to pass the FileMessage object as an argument to the parameter in the sendMediaFileMessage() method.
- Java
- Kotlin
| Argument | Type | Description |
|---|---|---|
| MESSAGE_PARAMS | FileMessage | Object to hold the parameters of the audio message |
| CALLBACK | SendMessageCallback | callback to observe the action status |
Note : In ChatManager
.setMediaFolderNameshould be defined to set your own local path to store app media files.
caution
If Audio attachment feature unavailable for your plan then it will throw 403 exception.
caution
FlyMessenger.sendFileMessage() method was deprecated and will be removed in the future release. migrate to FlyMessenger.sendMediaFileMessage() method to send Audio files.
Audio message with url#
To send audio as a message call the below method. You can upload the audio file to your storage of choice and send the url and other necessary info while sending the message.
To send your audio message, you need to pass the FileMessage object as an argument to the parameter in the sendMediaFileMessage() method.
- Java
- Kotlin
| Argument | Type | Description |
|---|---|---|
| MESSAGE_PARAMS | FileMessage | Object to hold the parameters of the audio message |
| CALLBACK | SendMessageCallback | callback to observe the action status |
caution
If Audio attachment feature unavailable for your plan then it will throw 403 exception.
caution
FlyMessenger.sendFileMessage() method was deprecated and will be removed in the future release. migrate to FlyMessenger.sendMediaFileMessage() method to send Audio files.
Document message#
Document sharing is very useful communication between users. sdk provides methods to send the document message to the end users. once the user has sent message via sdk, it will give callback with status. if you want send the document message for a user, you can utilise the below method.
To send your document message, you need to pass the FileMessage object as an argument to the parameter in the sendMediaFileMessage() method.
- Java
- Kotlin
| Argument | Type | Description |
|---|---|---|
| MESSAGE_PARAMS | FileMessage | Object to hold the parameters of the document message |
| CALLBACK | SendMessageCallback | callback to observe the action status |
Note : In ChatManager
.setMediaFolderNameshould be defined to set your own local path to store app media files.
caution
If Document attachment feature unavailable for your plan then it will throw 403 exception.
caution
FlyMessenger.sendFileMessage() method was deprecated and will be removed in the future release. migrate to FlyMessenger.sendMediaFileMessage() method to send Document files.
Document message with url#
If you have uploaded the document to your own media server and the you want to share document with other user. sdk provides methods to send the document message to the end users. once the user has sent message via sdk, it will give callback with status. if you want send the document message for a user, you can utilise the below method.
To send your document message, you need to pass the FileMessage object as an argument to the parameter in the sendMediaFileMessage() method.
- Java
- Kotlin
| Argument | Type | Description |
|---|---|---|
| MESSAGE_PARAMS | FileMessage | Object to hold the parameters of the document message |
| CALLBACK | SendMessageCallback | callback to observe the action status |
caution
If Document attachment feature unavailable for your plan then it will throw 403 exception.
caution
FlyMessenger.sendFileMessage() method was deprecated and will be removed in the future release. migrate to FlyMessenger.sendMediaFileMessage() method to send Document files.
Location message#
Location sharing is a famous communication between users. sdk provides methods to send the location message to the end users. once the user has sent message via sdk, it will give callback with status. if you want send the location message for a user, you can utilise the below method.
To send your location message, you need to pass the FileMessage object as an argument to the parameter in the sendMediaFileMessage() method.
- Java
- Kotlin
| Argument | Type | Description |
|---|---|---|
| MESSAGE_PARAMS | FileMessage | Object to hold the parameters of the location message |
| CALLBACK | SendMessageCallback | callback to observe the action status |
caution
If Location attachment feature unavailable for your plan then it will throw 403 exception.
caution
FlyMessenger.sendFileMessage() method was deprecated and will be removed in the future release. migrate to FlyMessenger.sendMediaFileMessage() method to send Location message.
Contact message#
Contact sharing is very useful communication between users. sdk provides methods to send the contact message to the end users. once the user has sent message via sdk, it will give callback with status. if you want send the contact message for a user, you can utilise the below method.
To send your contact message, you need to pass the FileMessage object as an argument to the parameter in the sendMediaFileMessage() method.
- Java
- Kotlin
| Argument | Type | Description |
|---|---|---|
| MESSAGE_PARAMS | FileMessage | Object to hold the parameters of the contact message |
| CALLBACK | SendMessageCallback | callback to observe the action status |
caution
If Contact attachment feature unavailable for your plan then it will throw 403 exception.
caution
FlyMessenger.sendFileMessage() method was deprecated and will be removed in the future release. migrate to FlyMessenger.sendMediaFileMessage() method to send Contact message.
Meet message#
A meet message typically refers to a message or communication related to scheduling or planning a meeting. These messages can include information about the Scheduled date,time and meet link.
Create Meet link#
Before you send the meet message, you need to create the meet link using the createMeetLink method. Once the meet link has been created successfully, you can send the Meet message.
caution
If Group call feature is unavailable for your plan, then it will throw 403 exception
- Java
- Kotlin
To send your Meet message, you need to pass the MeetMessage object as an argument to the parameter in the sendMeetMessage() method.
- Java
- Kotlin
| Argument | Type | Description |
|---|---|---|
| MESSAGE_PARAMS | MeetMessage | Object to hold the parameters of the meet message |
| CALLBACK | SendMessageCallback | callback to observe the action status |