changeOwner method

Future<void> changeOwner(
  1. String groupId,
  2. String newOwner
)

Changes the group owner. Only the group owner can call this method.

Param groupId The group ID. Param newOwner The new group owner.

Returns None.

Throws Exception description, see ChatError.

Implementation

Future<void> changeOwner(
  String groupId,
  String newOwner,
) async {
  try {
    Map req = {'groupId': groupId, 'owner': newOwner};
    Map result = await platform_interface.Client.instance.groupManager
        .callNativeMethod(ChatMethodKeys.updateGroupOwner, req);
    ChatError.hasErrorFromResult(result);
  } catch (e) {
    rethrow;
  }
}