Skip to content

Commit

Permalink
Refactored code as per review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
sacOO7 committed Feb 22, 2024
1 parent 7609df0 commit 9236ea0
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion lib/src/platform/src/realtime/connection.dart
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ class Connection extends PlatformObject {
/// member.
String? id;

/// fetchId returns unique public identifier for this connection.
/// used to identify this member.
Future<String?> fetchId() =>
invoke<String?>(PlatformMethod.connectionId);

/// A unique private connection key used to recover or resume a connection,
/// assigned by Ably.
///
Expand All @@ -49,7 +54,19 @@ class Connection extends PlatformObject {
/// to publish on behalf of this client. See the
/// [publishing over REST on behalf of a realtime client docs](https://ably.com/docs/rest/channels#publish-on-behalf)
/// for more info.
Future<String?> get key => invoke<String?>(PlatformMethod.connectionKey);
String? key;

/// fetchKey returns a unique private connection key used to recover
/// or resume a connection, assigned by Ably.
///
/// When recovering a connection explicitly, the `recoveryKey` is used in the
/// recover client options as it contains both the key and the last message
/// serial. This private connection key can also be used by other REST clients
/// to publish on behalf of this client. See the
/// [publishing over REST on behalf of a realtime client docs](https://ably.com/docs/rest/channels#publish-on-behalf)
/// for more info.
Future<String?> fetchKey() =>
invoke<String?>(PlatformMethod.connectionKey);

/// The recovery key string can be used by another client to recover this
/// connection's state in the recover client options property.
Expand Down

0 comments on commit 9236ea0

Please sign in to comment.