deleteMessagesForMe method
Future<void>
deleteMessagesForMe(
- String jid,
- String chatType,
- List<
String> messageIds, - bool? isMediaDelete,
- dynamic callback(
- FlyResponse response
override
This method is used to delete the messages locally for the user.
Implementation
@override
Future<void> deleteMessagesForMe(
String jid,
String chatType,
List<String> messageIds,
bool? isMediaDelete,
Function(FlyResponse response)? callback) async {
bool? messageDeleteResponse;
try {
messageDeleteResponse = await mirrorFlyMethodChannel
.invokeMethod<bool>('deleteMessagesForMe', {
"jid": jid,
"chat_type": chatType,
"isMediaDelete": isMediaDelete,
"message_ids": messageIds
});
LogMessage.d("deleteMessagesForMe Response ", " $messageDeleteResponse");
callback?.call(FlyResponse(true, FlyConstants.empty, FlyConstants.empty));
// return messageDeleteResponse ?? false;
} on PlatformException catch (e) {
LogMessage.d("Platform Exception =", " $e");
callback?.call(FlyResponse(false, FlyConstants.empty, FlyConstants.empty,
FlyException(e.code, e.message, e.details)));
} on Exception catch (e) {
LogMessage.d("Exception ", " $e");
callback?.call(FlyResponse(false, FlyConstants.empty, FlyConstants.empty,
FlyException(FlyErrorCode.unHandle, FlyErrorMessage.unHandle, e)));
}
}