getCurrentDeviceId method

Future<String> getCurrentDeviceId()

~english Gets the current device ID.

Return The current device ID. ~end

~chinese 获取当前设备 ID。

Return 当前设备 ID。 ~end

Implementation

Future<String> getCurrentDeviceId() async {
  try {
    Map result = await platform_interface.Client.instance.callNativeMethod(
      ChatMethodKeys.getCurrentDeviceId,
    );
    ChatError.hasErrorFromResult(result);
    ChatDeviceInfo deviceInfo = ChatDeviceInfo.fromJson(
      result[ChatMethodKeys.getCurrentDeviceId],
    );
    return deviceInfo.deviceUUID ?? '';
  } catch (e) {
    rethrow;
  }
}