markAsInteracted static method
- int messageId,
- String interactedElementId,
- {required dynamic onSuccess( )?,
- required dynamic onError(
- CometChatException excep
Messages elements can be marked as interacted.
messageId
The ID of the message above which all messages for a particular conversation are to be marked as read.
method could throw PlatformException with error codes specifying the cause
Implementation
static Future<void> markAsInteracted(int messageId, String interactedElementId ,{required Function(String)? onSuccess, required Function(CometChatException excep)? onError}) async {
try {
final result = await channel.invokeMethod('markAsInteracted', {
'messageId': messageId,
"interactedElementId": interactedElementId
});
if(onSuccess != null) onSuccess(result);
} on PlatformException catch (platformException) {
if(onError != null) onError(CometChatException(platformException.code, platformException.details, platformException.message));
} catch (e) {
debugPrint("Error: $e");
if(onError != null) onError(CometChatException(ErrorCode.errorUnhandledException, e.toString() , e.toString()));
}
}