getCurrentUserId method
~english Gets the current login user ID.
Return The current login user ID. ~end
~chinese 获取当前登录的用户 ID。
Return 当前登录的用户 ID。 ~end
Implementation
Future<String?> getCurrentUserId() async {
Map result =
await ClientChannel.invokeMethod(ChatMethodKeys.getCurrentUser);
try {
ChatError.hasErrorFromResult(result);
_currentUserId = result[ChatMethodKeys.getCurrentUser];
if (_currentUserId != null) {
if (_currentUserId!.length == 0) {
_currentUserId = null;
}
}
return _currentUserId;
} on ChatError catch (e) {
throw e;
}
}