Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 21 additions & 1 deletion Sources/_AblyPluginSupportPrivate/include/APLiveObjectsPlugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,11 @@ NS_SWIFT_SENDABLE
- (NSDictionary<NSString *, id> *)encodeObjectMessage:(id<APObjectMessageProtocol>)objectMessage
format:(APEncodingFormat)format;

/// Called when a channel received an `ATTACHED` `ProtocolMessage`. (This is copied from ably-js, will document this method properly once exact meaning decided.)
/// Called when a channel received an `ATTACHED` `ProtocolMessage`.
///
/// Superseded by the optional `nosync_onChannelAttached:hasObjects:resumed:` method,
/// which includes the `RESUMED` flag. If ably-cocoa detects that the plugin implements the
/// newer method, it will call that instead of this one.
///
/// Parameters:
/// - channel: The channel that received the `ProtocolMessage`.
Expand Down Expand Up @@ -91,6 +95,22 @@ NS_SWIFT_SENDABLE
- (void)nosync_onConnectedWithConnectionDetails:(nullable id<APConnectionDetailsProtocol>)connectionDetails
channel:(id<APRealtimeChannel>)channel;

@optional

/// Called when a channel received an `ATTACHED` `ProtocolMessage`.
///
/// This method supersedes `nosync_onChannelAttached:hasObjects:` by including the `RESUMED` flag.
/// If this method is implemented, ably-cocoa will call it instead of `nosync_onChannelAttached:hasObjects:`.
///
/// Parameters:
/// - channel: The channel that received the `ProtocolMessage`.
/// - hasObjects: Whether the `ProtocolMessage` has the `HAS_OBJECTS` flag set.
/// - resumed: Whether the `ProtocolMessage` has the `RESUMED` flag set.
- (void)nosync_onChannelAttached:(id<APRealtimeChannel>)channel
hasObjects:(BOOL)hasObjects
resumed:(BOOL)resumed
NS_SWIFT_NAME(nosync_onChannelAttached(_:hasObjects:resumed:));

@end

/// An `ObjectMessage`, as found in the `state` property of an `OBJECT` or `OBJECT_SYNC` `ProtocolMessage`.
Expand Down