sendTransientMessage static method
dynamic
sendTransientMessage(
- TransientMessage message, {
- required dynamic onSuccess()?,
- required dynamic onError(
- CometChatException excep
Transient messages are messages that are sent in real-time only
method send transient message
data
A JSONObject to provide data.
method could throw PlatformException with error codes specifying the cause
Implementation
static sendTransientMessage(TransientMessage message,
{required Function()? onSuccess,
required Function(CometChatException excep)? onError}) async {
try {
await channel.invokeMethod('sendTransientMessage', {
'receiverId': message.receiverId,
'receiverType': message.receiverType,
'data': message.data,
});
if (onSuccess != null) onSuccess();
} on PlatformException catch (p) {
_errorCallbackHandler(null, p, null, onError);
} catch (e) {
_errorCallbackHandler(null, null, e, onError);
}
}