Skip to content

Commit

Permalink
Refactored connection dart file to include createRecoveryKey method
Browse files Browse the repository at this point in the history
  • Loading branch information
sacOO7 committed Feb 22, 2024
1 parent 3a109df commit 682d4f1
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions lib/src/platform/src/realtime/connection.dart
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ class Connection extends PlatformObject {

/// A unique public identifier for this connection, used to identify this
/// member.
Future<String?> get id async =>
invoke<String?>(PlatformMethod.connectionId);
Future<String?> get id => invoke<String?>(PlatformMethod.connectionId);

/// A unique private connection key used to recover or resume a connection,
/// assigned by Ably.
Expand All @@ -49,15 +48,22 @@ 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 async =>
invoke<String?>(PlatformMethod.connectionKey);
Future<String?> get key => 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.
///
/// See [connection state recover options](https://ably.com/docs/realtime/connection#connection-state-recover-options)
/// for more information.\
@Deprecated('Use createRecoveryKey instead')
Future<String?> get recoveryKey => createRecoveryKey();

/// The createRecoveryKey returns key string can be used by another client to
/// recover this connection's state in the recover client options property.
///
/// See [connection state recover options](https://ably.com/docs/realtime/connection#connection-state-recover-options)
/// for more information.
Future<String?> get recoveryKey async =>
Future<String?> createRecoveryKey() =>
invoke<String?>(PlatformMethod.connectionRecoveryKey);

/// The serial number of the last message to be received on this connection,
Expand Down

0 comments on commit 682d4f1

Please sign in to comment.