sendMessage static method
Future<void>
sendMessage({
- required MessageParams messageParams,
- required dynamic flyCallback(
- FlyResponse response
Sends a message using the Mirrorfly messaging platform.
This method sends a message using the provided messageParams
and
asynchronously invokes the flyCallback
function with the result.
The messageParams
parameter contains the details of the message to be sent,
using MessageParams class.
The flyCallback
parameter is a function that will be called with a FlyResponse
object containing information about the success or failure of the message sending operation.
Example usage:
await Mirrorfly.sendMessage(
messageParams: messageParams,
flyCallback: (FlyResponse response) {
if (response.isSuccess) {
print('Message sent successfully');
} else {
print('Failed to send message: ${response.errorMessage}');
}
},
);
Implementation
static Future<void> sendMessage(
{required MessageParams messageParams,
required Function(FlyResponse response) flyCallback}) {
return FlyChatFlutterPlatform.instance
.sendMessage(messageParams: messageParams, callback: flyCallback);
}