Skip to content

Commit 3989f34

Browse files
Merge pull request #4 from ably/add-server-time-api
Add API for fetching server time
2 parents dffe135 + 37ad19d commit 3989f34

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Sources/_AblyPluginSupportPrivate/include/APPluginAPI.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,14 @@ NS_SWIFT_SENDABLE
7272
/// Returns a realtime channel's current state.
7373
- (APRealtimeChannelState)nosync_stateForChannel:(id<APRealtimeChannel>)channel;
7474

75+
/// Fetches the Ably server time from the REST API, per RTO16.
76+
///
77+
/// Per RTO16a, if the client knows the local clock's offset from the server time, then the server time will be calculated without making a request.
78+
///
79+
/// The completion handler will be called on the client's internal queue (see `-internalQueueForClient:`).
80+
- (void)nosync_fetchServerTimeForClient:(id<APRealtimeClient>)client
81+
completion:(void (^ _Nullable)(NSDate *_Nullable serverTime, _Nullable id<APPublicErrorInfo> error))completion;
82+
7583
/// Logs a message to a logger.
7684
- (void)log:(NSString *)message
7785
withLevel:(APLogLevel)level

0 commit comments

Comments
 (0)