getSelfIdsOnOtherPlatform method Null safety

Future<List<String>?> getSelfIdsOnOtherPlatform()

Gets the unique IDs of the current user on the other devices. The ID is in the format of username + "/" + resource.

Return The list of unique IDs of users on the other devices if the method succeeds.

Throws A description of the exception. See {@link EMError}.

Implementation

Future<List<String>?> getSelfIdsOnOtherPlatform() async {
  Map result =
      await _channel.invokeMethod(ChatMethodKeys.getSelfIdsOnOtherPlatform);
  try {
    EMError.hasErrorFromResult(result);
    List<String>? devices =
        result[ChatMethodKeys.getSelfIdsOnOtherPlatform]?.cast<String>();
    return devices;
  } on EMError catch (e) {
    throw e;
  }
}