getConversationUpdateSettings static method

Future<ConversationUpdateSettings> getConversationUpdateSettings({
  1. dynamic onSuccess(
    1. ConversationUpdateSettings
    )?,
  2. dynamic onError(
    1. CometChatException excep
    )?,
})

Retrieves the ConversationUpdateSettings object to enable or disable certain features.

Implementation

static Future<ConversationUpdateSettings> getConversationUpdateSettings(
    {Function(ConversationUpdateSettings)? onSuccess,
    Function(CometChatException excep)? onError}) async {
  try {
    final result =
        await channel.invokeMethod('getConversationUpdateSettings');
    Map<dynamic, dynamic> map = result;
    if (result == null) {
      if (onSuccess != null) {
        onSuccess(ConversationUpdateSettings(
            callActivities: true,
            customMessages: true,
            messageReplies: true,
            groupActions: true));
      }
    } else {
      final ConversationUpdateSettings res =
          ConversationUpdateSettings.fromMap(map);
      if (onSuccess != null) {
        onSuccess(res);
      }
      return res;
    }
  } on PlatformException catch (p) {
    _errorCallbackHandler(null, p, null, onError);
  } catch (e) {
    _errorCallbackHandler(null, null, e, onError);
  }
  return ConversationUpdateSettings(
      callActivities: true,
      customMessages: true,
      messageReplies: true,
      groupActions: true);
}