getConversationSummary static method
Implementation
static Future<void> getConversationSummary(String receiverId, String receiverType, {Map? configuration, required Function(String conversationSummary) onSuccess, required Function(CometChatException e) onError}) async{
try{
if(receiverId.isEmpty){
onError(CometChatException(ErrorCode.errorInvalidReceiverId, ErrorMessage.errorMessageInvalidReceiverId, ErrorMessage.errorMessageInvalidReceiverId));
}else if(receiverType.isEmpty){
onError(CometChatException(ErrorCode.errorInvalidReceiverType, ErrorMessage.errorMessageInvalidReceiverType, ErrorMessage.errorMessageInvalidReceiverType));
}else{
final arguments = {
"receiverId": receiverId,
"receiverType": receiverType,
"configuration": configuration
};
final result = await channel.invokeMethod('getConversationSummary', arguments);
String arrayOfStrings = result;
onSuccess(arrayOfStrings);
}
} on PlatformException catch (e) {
debugPrint("Error: $e");
onError(CometChatException(e.code, e.details, e.message));
} catch (e) {
debugPrint("Error: $e");
onError(CometChatException(ErrorCode.errorUnhandledException, e.toString() , e.toString()));
}
}