Classes

The following classes are available globally.

  • Undocumented

    See more

    Declaration

    Objective-C

    @interface ARTAnnotation : NSObject<NSCopying>
    
    /// A Unique ID assigned by Ably to this message.
    @property (nullable, readonly, nonatomic) NSString *id;
    
    /// The action, whether this is an annotation being added or removed, one of the `ARTAnnotationAction` enum values.
    @property (readonly, nonatomic) ARTAnnotationAction action;
    
    /// The client ID of the publisher of this message.
    @property (nonatomic, readonly, nullable) NSString *clientId;
    
    /// The name of this annotation. This is the field that most annotation aggregations will operate on. For example, using "distinct.v1" aggregation (specified in the type), the message summary will show a list of clients who have published an annotation with each distinct annotation.name.
    @property (nullable, readonly, nonatomic) NSString *name;
    
    /// An optional count, only relevant to certain aggregation methods, see aggregation methods documentation for more info.
    @property (nullable, readonly, nonatomic) NSNumber *count;
    
    /// The message payload, if provided.
    @property (nonatomic, readonly, nullable) id data;
    
    /// This is typically empty, as all messages received from Ably are automatically decoded client-side using this value. However, if the message encoding cannot be processed, this attribute contains the remaining transformations not applied to the `data` payload.
    @property (nonatomic, readonly, nullable) NSString *encoding;
    
    /// Timestamp of when the message was received by Ably, as a `NSDate` object.
    @property (nullable, nonatomic, readonly) NSDate *timestamp;
    
    /// This annotation's unique serial (lexicographically totally ordered).
    @property (readonly, nonatomic) NSString *serial;
    
    /// The serial of the message (of type `MESSAGE_CREATE`) that this annotation is annotating.
    @property (readonly, nonatomic) NSString *messageSerial;
    
    /// The type of annotation it is, typically some identifier together with an aggregation method; for example: "emoji:distinct.v1". Handled opaquely by the SDK and validated serverside.
    @property (readonly, nonatomic) NSString *type;
    
    /// A JSON object of arbitrary key-value pairs that may contain metadata, and/or ancillary payloads.
    @property (nullable, readonly, nonatomic) id<ARTJsonCompatible> extras;
    
    - (instancetype)initWithId:(nullable NSString *)annotationId
                        action:(ARTAnnotationAction)action
                      clientId:(nullable NSString *)clientId
                          name:(nullable NSString *)name
                         count:(nullable NSNumber *)count
                          data:(nullable id)data
                      encoding:(nullable NSString *)encoding
                     timestamp:(NSDate *)timestamp
                        serial:(NSString *)serial
                 messageSerial:(NSString *)messageSerial
                          type:(NSString *)type
                        extras:(nullable id<ARTJsonCompatible>)extras;
    @end

    Swift

    class ARTAnnotation : NSObject, NSCopying, @unchecked Sendable
  • Provides parameters for a request to perform an operation that may ultimately call ARTChannelRealtimeInternal’s internalAttach:callback: method.

    See more

    Declaration

    Objective-C

    
    @interface ARTAttachRequestParams : NSObject

    Swift

    class AttachRequestParams : NSObject
  • Maintains the state that an ARTRealtimeChannel instance needs in order to determine the duration to wait before retrying an attach. Wraps a sequence of ARTRetrySequence objects.

    See more

    Declaration

    Objective-C

    
    @interface ARTAttachRetryState : NSObject

    Swift

    class AttachRetryState : NSObject
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface ARTAuthInternal : NSObject
    
    @property (nullable, readonly) NSString *clientId;
    @property (nullable, nonatomic, readonly) ARTTokenDetails *tokenDetails;
    
    - (void)requestToken:(nullable ARTTokenParams *)tokenParams
             withOptions:(nullable ARTAuthOptions *)authOptions
                callback:(ARTTokenDetailsCallback)callback;
    
    - (void)requestToken:(ARTTokenDetailsCallback)callback;
    
    - (void)authorize:(nullable ARTTokenParams *)tokenParams
              options:(nullable ARTAuthOptions *)authOptions
             callback:(ARTTokenDetailsCallback)callback;
    
    - (void)authorize:(ARTTokenDetailsCallback)callback;
    
    - (void)createTokenRequest:(nullable ARTTokenParams *)tokenParams
                       options:(nullable ARTAuthOptions *)options
                      callback:(void (^)(ARTTokenRequest *_Nullable tokenRequest, NSError *_Nullable error))callback;
    
    - (void)createTokenRequest:(void (^)(ARTTokenRequest *_Nullable tokenRequest, NSError *_Nullable error))callback;
    
    @end

    Swift

    class ARTAuthInternal : NSObject
  • Creates Ably ARTTokenRequest objects and obtains Ably Tokens from Ably to subsequently issue to less trusted clients.

    See

    See ARTAuthProtocol for details.
    See more

    Declaration

    Objective-C

    @interface ARTAuth : NSObject <ARTAuthProtocol>

    Swift

    class ARTAuth : NSObject, ARTAuthProtocol, @unchecked Sendable
  • Passes authentication-specific properties in authentication requests to Ably. Properties set using ARTAuthOptions are used instead of the default values set when the client library is instantiated, as opposed to being merged with them.

    See more

    Declaration

    Objective-C

    @interface ARTAuthOptions : NSObject <NSCopying>

    Swift

    class ARTAuthOptions : NSObject, NSCopying
  • An implementation of ARTRetryDelayCalculator which uses the incremental backoff and jitter rules of RTB1.

    See more

    Declaration

    Objective-C

    
    @interface ARTBackoffRetryDelayCalculator : NSObject <ARTRetryDelayCalculator>

    Swift

    class BackoffRetryDelayCalculator : NSObject, RetryDelayCalculator
  • A base interface for an ARTMessage and an ARTPresenceMessage objects.

    See more

    Declaration

    Objective-C

    @interface ARTBaseMessage : NSObject <NSCopying>

    Swift

    class ARTBaseMessage : NSObject, NSCopying
  • The base class for ARTRestChannel and ARTRealtimeChannel. Ably platform service organizes the message traffic within applications into named channels. Channels are the medium through which messages are distributed; clients attach to channels to subscribe to messages, and every message published to a unique channel is broadcast by Ably to all subscribers.

    See

    See ARTChannelProtocol for details.
    See more

    Declaration

    Objective-C

    @interface ARTChannel : NSObject

    Swift

    class ARTChannel : NSObject, @unchecked Sendable
  • Passes additional properties to an ARTRestChannel object, such as encryption.

    See more

    Declaration

    Objective-C

    @interface ARTChannelOptions : NSObject <NSCopying>

    Swift

    class ARTChannelOptions : NSObject, NSCopying
  • Provides parameters for a request to perform an operation that may cause an ARTRealtimeChannelInternal instance to emit a connection state change.

    ARTRealtimeChannelInternal will incorporate some of this data into the ARTChannelStateChange object that it emits as a result of the connection state change.

    See more

    Declaration

    Objective-C

    
    @interface ARTChannelStateChangeParams : NSObject

    Swift

    class ChannelStateChangeParams : NSObject
  • Creates and destroys ARTRestChannel and ARTRealtimeChannel objects.

    See more

    Declaration

    Objective-C

    @interface ARTChannels<ChannelType> : NSObject

    Swift

    class ARTChannels<ChannelType> : NSObject, @unchecked Sendable where ChannelType : AnyObject
  • Passes additional client-specific properties to the REST -[ARTRestProtocol initWithOptions:] or the Realtime -[ARTRealtimeProtocol initWithOptions:].

    See more

    Declaration

    Objective-C

    @interface ARTClientOptions : ARTAuthOptions

    Swift

    class ARTClientOptions : ARTAuthOptions
  • Maintains the state that an ARTRealtime instance needs in order to determine the duration to wait before retrying a connection. Wraps a sequence of ARTRetrySequence objects.

    See more

    Declaration

    Objective-C

    
    @interface ARTConnectRetryState : NSObject

    Swift

    class ConnectRetryState : NSObject
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface ARTConnectionRecoveryKey : NSObject
    
    @property (readonly, nonatomic) NSString *connectionKey;
    @property (readonly, nonatomic) int64_t msgSerial;
    @property (readonly, nonatomic) NSDictionary<NSString *, NSString *> *channelSerials;
    
    - (instancetype)initWithConnectionKey:(NSString *)connectionKey
                                msgSerial:(int64_t)msgSerial
                           channelSerials:(NSDictionary<NSString *, NSString *> *)channelSerials;
    
    - (NSString *)jsonString;
    + (nullable ARTConnectionRecoveryKey *)fromJsonString:(NSString *)json error:(NSError *_Nullable *_Nullable)errorPtr;
    
    @end

    Swift

    class ARTConnectionRecoveryKey : NSObject
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface ARTConnectionInternal : NSObject
    
    @property (nullable, readonly, nonatomic) NSString *id;
    @property (nullable, readonly, nonatomic) NSString *key;
    @property (readonly, nonatomic) NSInteger maxMessageSize;
    @property (readonly, nonatomic) ARTRealtimeConnectionState state;
    @property (nullable, readonly, nonatomic) ARTErrorInfo *errorReason;
    
    - (instancetype)initWithRealtime:(ARTRealtimeInternal *)realtime logger:(ARTInternalLog *)logger;
    
    - (nullable NSString *)id_nosync;
    - (nullable NSString *)key_nosync;
    - (BOOL)isActive_nosync;
    - (ARTRealtimeConnectionState)state_nosync;
    - (nullable ARTErrorInfo *)errorReason_nosync;
    - (nullable ARTErrorInfo *)error_nosync;
    - (nullable NSString *)createRecoveryKey_nosync;
    
    @property (readonly, nonatomic) ARTEventEmitter<ARTEvent *, ARTConnectionStateChange *> *eventEmitter;
    @property(weak, nonatomic) ARTRealtimeInternal* realtime; // weak because realtime owns self
    
    - (void)setId:(NSString *_Nullable)newId;
    - (void)setKey:(NSString *_Nullable)key;
    - (void)setMaxMessageSize:(NSInteger)maxMessageSize;
    - (void)setState:(ARTRealtimeConnectionState)state;
    - (void)setErrorReason:(ARTErrorInfo *_Nullable)errorReason;
    
    - (void)emit:(ARTRealtimeConnectionEvent)event with:(ARTConnectionStateChange *)data;
    
    @property (readonly, nonatomic) dispatch_queue_t queue;
    
    @property (nullable, readonly) NSString *recoveryKey DEPRECATED_MSG_ATTRIBUTE("Use `createRecoveryKey` method instead.");
    
    - (nullable NSString *)createRecoveryKey;
    
    - (void)connect;
    
    - (void)close;
    
    - (void)ping:(ARTCallback)callback;
    
    #pragma mark ARTEventEmitter
    
    /**
     * Embeds an `ARTEventEmitter` object.
     */
    ART_EMBED_INTERFACE_EVENT_EMITTER(ARTRealtimeConnectionEvent, ARTConnectionStateChange *)
    
    @end

    Swift

    class ARTConnectionInternal : NSObject
  • Enables the management of a connection to Ably.

    See

    See ARTConnectionProtocol for details.
    See more

    Declaration

    Objective-C

    @interface ARTConnection : NSObject <ARTConnectionProtocol>

    Swift

    class ARTConnection : NSObject, ARTConnectionProtocol, @unchecked Sendable
  • Contains any constraints a client should adhere to and provides additional metadata about a ARTConnection, such as if a request to -[ARTChannelProtocol publish:callback:] a message that exceeds the maximum message size should be rejected immediately without communicating with Ably.

    See more

    Declaration

    Objective-C

    @interface ARTConnectionDetails : NSObject

    Swift

    class ARTConnectionDetails : NSObject, @unchecked Sendable
  • Provides parameters for a request to perform an operation that may cause an ARTRealtimeInternal instance to emit a connection state change.

    ARTRealtimeInternal will incorporate this data into the ARTConnectionStateChange object that it emits as a result of the connection state change.

    See more

    Declaration

    Objective-C

    
    @interface ARTConnectionStateChangeParams : NSObject

    Swift

    class ConnectionStateChangeParams : NSObject
  • A clock that increments monotonically, including while the system is asleep.

    Note

    We don’t give this one an NS_SWIFT_NAME, to avoid confusion with the Swift standard library type also named ContinuousClock.
    See more

    Declaration

    Objective-C

    @interface ARTContinuousClock : NSObject

    Swift

    class ARTContinuousClock : NSObject
  • Represents an instant in time, as described by an instance of ARTContinuousClock.

    See more

    Declaration

    Objective-C

    @interface ARTContinuousClockInstant : NSObject

    Swift

    class ARTContinuousClockInstant : NSObject
  • Sets the properties to configure encryption for an ARTRestChannel or ARTRealtimeChannel object.

    See more

    Declaration

    Objective-C

    @interface ARTCipherParams : NSObject <ARTCipherParamsCompatible>

    Swift

    class ARTCipherParams : NSObject, ARTCipherParamsCompatible
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface ARTCbcCipher : NSObject<ARTChannelCipher>
    
    - (id)initWithCipherParams:(ARTCipherParams *)cipherParams logger:(ARTInternalLog *)logger;
    + (instancetype)cbcCipherWithParams:(ARTCipherParams *)cipherParams logger:(ARTInternalLog *)logger;
    
    
    @property (nonatomic) ARTInternalLog *logger;
    @property (readonly, nonatomic) NSData *keySpec;
    @property NSData *iv;
    @property (readonly) NSUInteger blockLength;
    
    @end

    Swift

    class ARTCbcCipher : NSObject, ARTChannelCipher
  • Contains the properties required to configure the encryption of ARTMessage payloads.

    See more

    Declaration

    Objective-C

    @interface ARTCrypto : NSObject

    Swift

    class ARTCrypto : NSObject
  • ARTDataEncoder is used to:

    • convert the data property of an ARTMessage into a format that’s suitable to be sent over the wire; that is, to ensure that this ARTMessage can be placed inside an ARTProtocolMessage
    • convert the data property of an ARTMessage contained inside an ARTProtocolMessage into something that’s suitable to expose to the user of the SDK
    See more

    Declaration

    Objective-C

    @interface ARTDataEncoder : NSObject

    Swift

    class ARTDataEncoder : NSObject
  • This object is used for providing parameters into methods with paginated results.

    See more

    Declaration

    Objective-C

    @interface ARTDataQuery : NSObject

    Swift

    class ARTDataQuery : NSObject
  • This object is used for providing parameters into ARTRealtimePresence‘s methods with paginated results.

    See more

    Declaration

    Objective-C

    @interface ARTRealtimeHistoryQuery : ARTDataQuery

    Swift

    class ARTRealtimeHistoryQuery : ARTDataQuery
  • Represents default library settings.

    See more

    Declaration

    Objective-C

    @interface ARTDefault : NSObject

    Swift

    class ARTDefault : NSObject
  • Contains the properties of a device registered for push notifications.

    See more

    Declaration

    Objective-C

    @interface ARTDeviceDetails : NSObject

    Swift

    class ARTDeviceDetails : NSObject, @unchecked Sendable
  • An object representing a unique device identity token used to communicate with APNS.

    See more

    Declaration

    Objective-C

    @interface ARTDeviceIdentityTokenDetails : NSObject <NSSecureCoding>

    Swift

    class ARTDeviceIdentityTokenDetails : NSObject, NSSecureCoding
  • Contains the details of the push registration of a device.

    See more

    Declaration

    Objective-C

    @interface ARTDevicePushDetails : NSObject

    Swift

    class ARTDevicePushDetails : NSObject, @unchecked Sendable
  • The implementation of ARTErrorChecker that should be used in non-test code.

    Declaration

    Objective-C

    
    @interface ARTDefaultErrorChecker : NSObject <ARTErrorChecker>

    Swift

    class DefaultErrorChecker : NSObject, ErrorChecker
  • An object representing a listener returned by ARTEventEmitter methods.

    See more

    Declaration

    Objective-C

    @interface ARTEventListener : NSObject

    Swift

    class ARTEventListener : NSObject, @unchecked Sendable
  • A generic interface for event registration and delivery used in a number of the types in the Realtime client library. For example, the ARTConnection and ARTRealtimeChannel objects emit events for their state using the ARTEventEmitter pattern.

    See more

    Declaration

    Objective-C

    @interface ARTEventEmitter<EventType : id <ARTEventIdentification>, ItemType>
        : NSObject

    Swift

    class ARTEventEmitter<EventType, ItemType> : NSObject, @unchecked Sendable where EventType : ARTEventIdentification, ItemType : AnyObject

ARTEventListener

  • Undocumented

    See more

    Declaration

    Objective-C

    @interface ARTPublicEventEmitter<EventType : id <ARTEventIdentification>,
                                     ItemType>
        : ARTEventEmitter <EventType, ItemType>

    Swift

    class ARTPublicEventEmitter<EventType, ItemType> : ARTEventEmitter<EventType, ItemType> where EventType : ARTEventIdentification, ItemType : AnyObject
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface ARTInternalEventEmitter<EventType : id <ARTEventIdentification>,
                                       ItemType>
        : ARTEventEmitter <EventType, ItemType>

    Swift

    class ARTInternalEventEmitter<EventType, ItemType> : ARTEventEmitter<EventType, ItemType> where EventType : ARTEventIdentification, ItemType : AnyObject
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface ARTFallbackHosts : NSObject
    
    + (nullable NSArray<NSString *> *)hostsFromOptions:(ARTClientOptions *)options;
    
    @end

    Swift

    class ARTFallbackHosts : NSObject
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface ARTScheduledBlockHandle : NSObject
    - (instancetype)initWithDelay:(NSTimeInterval)delay queue:(dispatch_queue_t)queue block:(dispatch_block_t)block;
    - (void)cancel;
    @end

    Swift

    class ARTScheduledBlockHandle : NSObject
  • A superset of ARTPaginatedResult which represents a page of results plus metadata indicating the relative queries available to it. ARTHttpPaginatedResponse additionally carries information about the response to an HTTP request.

    See more

    Declaration

    Objective-C

    @interface ARTHTTPPaginatedResponse : ARTPaginatedResult <NSDictionary *>

    Swift

    class ARTHTTPPaginatedResponse : ARTPaginatedResult<NSDictionary>, @unchecked Sendable
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface ARTInternalLog: NSObject
    #endif
    
    /**
     Provides a shared logger to be used by all public class methods meeting the following criteria:
    
     - they wish to perform logging
     - they do not have access to any more appropriate logger
     - their signature is already locked since they are part of the public API of the library
    
     Currently, this returns a logger that will not actually output any log messages, but I’ve created https://github.com/ably/ably-cocoa/issues/1652 for us to revisit this.
     */
    @property (nonatomic, readonly, class) ARTInternalLog *sharedClassMethodLogger_readDocumentationBeforeUsing;
    
    /**
     Creates a logger which forwards its generated messages to the given core object.
     */
    - (instancetype)initWithCore:(id<ARTInternalLogCore>)core NS_DESIGNATED_INITIALIZER;
    
    /**
     A convenience initializer which creates a logger whose core is an instance of `ARTDefaultInternalLogCore` wrapping the given logger.
     */
    - (instancetype)initWithLogger:(id<ARTVersion2Log>)logger;
    /**
     A convenience initializer which creates a logger whose core is an instance of `ARTDefaultInternalLogCore` initialized with that class’s `initWithClientOptions:` initializer.
     */
    - (instancetype)initWithClientOptions:(ARTClientOptions *)clientOptions;
    - (instancetype)init NS_UNAVAILABLE;
    
    /**
     Passes the arguments through to the logger’s core object.
    
     It is not directly used by the internals of the `Ably` library, but it is used by:
    
     - some of our Swift tests (which can’t access the variadic method below), which want to be able to call a logging method on an instance of `ARTInternalLog`
     - `ARTPluginAPI`, to implement its conformance to the `APPluginAPIProtocol` protocol, which is used by plugins written in Swift
    */
    - (void)log:(NSString *)message withLevel:(ARTLogLevel)level file:(const char *)fileName line:(NSInteger)line;
    
    // This method should not be called directly — it is for use by the ARTLog* macros. It is tested via the tests of the macros.
    - (void)logWithLevel:(ARTLogLevel)level file:(const char *)fileName line:(NSUInteger)line format:(NSString *)format, ...  NS_FORMAT_FUNCTION(4,5);
    
    @property (nonatomic) ARTLogLevel logLevel;
    
    @end

    Swift

    class InternalLog : NSObject
  • The implementation of ARTInternalLogCore that should be used in non-test code.

    See more

    Declaration

    Objective-C

    
    @interface ARTDefaultInternalLogCore : NSObject <ARTInternalLogCore>

    Swift

    class DefaultInternalLogCore : NSObject, InternalLogCore
  • The implementation of ARTJitterCoefficientGenerator that should be used in non-test code.

    Declaration

    Objective-C

    
    @interface ARTDefaultJitterCoefficientGenerator
        : NSObject <ARTJitterCoefficientGenerator>

    Swift

    class DefaultJitterCoefficientGenerator : NSObject, JitterCoefficientGenerator
  • Undocumented

    Declaration

    Objective-C

    @interface ARTJsonEncoder : NSObject <ARTJsonLikeEncoderDelegate>
    
    @end

    Swift

    class ARTJsonEncoder : NSObject, ARTJsonLikeEncoderDelegate
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface ARTJsonLikeEncoder : NSObject <ARTEncoder>
    
    @property (nonatomic, nullable) id<ARTJsonLikeEncoderDelegate> delegate;
    
    - (instancetype)initWithDelegate:(id<ARTJsonLikeEncoderDelegate>)delegate;
    - (instancetype)initWithLogger:(ARTInternalLog *)logger delegate:(nullable id<ARTJsonLikeEncoderDelegate>)delegate;
    - (instancetype)initWithRest:(ARTRestInternal *)rest delegate:(nullable id<ARTJsonLikeEncoderDelegate>)delegate logger:(ARTInternalLog *)logger;
    
    @end

    Swift

    class ARTJsonLikeEncoder : NSObject, ARTEncoder
  • Contains the device identity token and secret of a device. ARTLocalDevice extends ARTDeviceDetails.

    See more

    Declaration

    Objective-C

    @interface ARTLocalDevice : ARTDeviceDetails

    Swift

    class ARTLocalDevice : ARTDeviceDetails, @unchecked Sendable
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface ARTLogLine : NSObject
    
    @property(nonatomic, readonly) NSDate *date;
    @property(nonatomic, readonly) ARTLogLevel level;
    @property(nonatomic, readonly) NSString *message;
    
    - (instancetype)initWithDate:(NSDate *)date level:(ARTLogLevel)level message:(NSString *)message;
    
    - (NSString *)toString;
    
    @end

    Swift

    class ARTLogLine : NSObject
  • ARTLogAdapter provides an implementation of ARTVersion2Log that writes all log messages to a given instance of ARTLog.

    The intention of this class is to allow us to maintain the public API of the SDK, which allows users to provide an ARTLog instance, whilst using ARTVersion2Log for logging inside the SDK. Upon the next major release of this library, when ARTVersion2Log will be renamed ARTLog and the current ARTLog will be removed, we can remove this class too.

    See more

    Declaration

    Objective-C

    
    @interface ARTLogAdapter : NSObject <ARTVersion2Log>

    Swift

    class LogAdapter : NSObject, Version2Log
  • An interface outlining the optional ARTMessageOperation object which resides in an ARTMessage object. This is populated within the ARTMessage object when the message is an update or delete operation.

    See more

    Declaration

    Objective-C

    @interface ARTMessageOperation : NSObject

    Swift

    class ARTMessageOperation : NSObject
  • Undocumented

    Declaration

    Objective-C

    @interface ARTMsgPackEncoder : NSObject <ARTJsonLikeEncoderDelegate>
    
    @end

    Swift

    class ARTMsgPackEncoder : NSObject, ARTJsonLikeEncoderDelegate
  • Undocumented

    Declaration

    Objective-C

    @interface ARTOSReachability : NSObject  <ARTReachability>
    @end

    Swift

    class ARTOSReachability : NSObject, ARTReachability
  • Contains a page of results for message or presence history, stats, or REST presence requests. An ARTPaginatedResult response from a REST API paginated query is also accompanied by metadata that indicates the relative queries available to the ARTPaginatedResult object.

    See more

    Declaration

    Objective-C

    @interface ARTPaginatedResult<ItemType> : NSObject

    Swift

    class ARTPaginatedResult<ItemType> : NSObject, @unchecked Sendable where ItemType : AnyObject
  • This object is used for providing parameters into ARTRestPresence‘s methods with paginated results.

    See more

    Declaration

    Objective-C

    @interface ARTPresenceQuery : NSObject

    Swift

    class ARTPresenceQuery : NSObject
  • Contains an individual presence update sent to, or received from, Ably.

    See more

    Declaration

    Objective-C

    @interface ARTPresenceMessage : ARTBaseMessage

    Swift

    class ARTPresenceMessage : ARTBaseMessage
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface ARTPushInternal : NSObject
    
    @property (nonatomic, readonly) ARTPushAdminInternal *admin;
    @property (readonly) dispatch_queue_t queue;
    
    - (instancetype)initWithRest:(ARTRestInternal *)rest logger:(ARTInternalLog *)logger;
    
    #if TARGET_OS_IOS
    - (void)getActivationMachine:(void (^)(ARTPushActivationStateMachine *))block;
    
    /// Direct access to _activationMachine var for internal testing.
    /// Throws an exception if there is no activation machine or it could not be locked immediately.
    @property (readonly) ARTPushActivationStateMachine *activationMachine;
    
    /// Create the _activationMachine manually with a custom delegate for internal testing.
    - (ARTPushActivationStateMachine *)createActivationStateMachineWithDelegate:(id<ARTPushRegistererDelegate, NSObject>)delegate;
    #endif
    
    #if TARGET_OS_IOS
    
    + (void)didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken rest:(ARTRest *)rest;
    
    + (void)didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken realtime:(ARTRealtime *)realtime;
    
    + (void)didFailToRegisterForRemoteNotificationsWithError:(NSError *)error rest:(ARTRest *)rest;
    
    + (void)didFailToRegisterForRemoteNotificationsWithError:(NSError *)error realtime:(ARTRealtime *)realtime;
    
    + (void)didRegisterForLocationNotificationsWithDeviceToken:(NSData *)deviceToken rest:(ARTRest *)rest;
    
    + (void)didRegisterForLocationNotificationsWithDeviceToken:(NSData *)deviceToken realtime:(ARTRealtime *)realtime;
    
    + (void)didFailToRegisterForLocationNotificationsWithError:(NSError *)error rest:(ARTRest *)rest;
    
    + (void)didFailToRegisterForLocationNotificationsWithError:(NSError *)error realtime:(ARTRealtime *)realtime;
    
    - (void)activate;
    
    - (void)deactivate;
    
    #endif
    
    @end

    Swift

    class ARTPushInternal : NSObject
  • Enables a device to be registered and deregistered from receiving push notifications.

    See more

    Declaration

    Objective-C

    @interface ARTPush : NSObject <ARTPushProtocol>

    Swift

    class ARTPush : NSObject, ARTPushProtocol, @unchecked Sendable
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface ARTPushActivationEvent : NSObject <NSSecureCoding>
    
    - (NSData *)archiveWithLogger:(nullable ARTInternalLog *)logger;
    + (nullable ARTPushActivationState *)unarchive:(NSData *)data withLogger:(nullable ARTInternalLog *)logger;
    
    @end

    Swift

    class ARTPushActivationEvent : NSObject, NSSecureCoding
  • Event with Error info

    See more

    Declaration

    Objective-C

    @interface ARTPushActivationErrorEvent : ARTPushActivationEvent

    Swift

    class ARTPushActivationErrorEvent : ARTPushActivationEvent
  • Event with Device Identity Token details

    See more

    Declaration

    Objective-C

    @interface ARTPushActivationDeviceIdentityEvent : ARTPushActivationEvent

    Swift

    class ARTPushActivationDeviceIdentityEvent : ARTPushActivationEvent

Events

States

ARTSRWebSocket

  • A ARTSRWebSocket object lets you connect, send and receive data to a remote Web Socket.

    See more

    Declaration

    Objective-C

    @interface ARTSRWebSocket : NSObject <ARTWebSocket, NSStreamDelegate>

    Swift

    class ARTSRWebSocket : NSObject, ARTWebSocket, StreamDelegate
  • Provides an interface for injecting additional configuration into ARTRest or ARTRealtime instances.

    This is for anything that test code wishes to be able to configure but which should not be part of the public API of these classes.

    See more

    Declaration

    Objective-C

    @interface ARTTestClientOptions : NSObject <NSCopying>

    Swift

    class ARTTestClientOptions : NSObject, NSCopying
  • Defines the properties of an Ably Token.

    See more

    Declaration

    Objective-C

    @interface ARTTokenParams : NSObject <NSCopying>

    Swift

    class ARTTokenParams : NSObject, NSCopying
  • Contains ARTRealtimeConnectionState change information emitted by the ARTConnection object.

    See more

    Declaration

    Objective-C

    @interface ARTConnectionStateChange : NSObject

    Swift

    class ARTConnectionStateChange : NSObject, @unchecked Sendable
  • Contains state change information emitted by an ARTRealtimeChannel object.

    See more

    Declaration

    Objective-C

    @interface ARTChannelStateChange : NSObject

    Swift

    class ARTChannelStateChange : NSObject, @unchecked Sendable
  • Undocumented

    Declaration

    Objective-C

    @interface ARTURLSessionServerTrust : NSObject<NSURLSessionDelegate, NSURLSessionTaskDelegate, ARTURLSession>
    
    @end

    Swift

    class ARTURLSessionServerTrust : NSObject, URLSessionDelegate, URLSessionTaskDelegate, ARTURLSession
  • The implementation of ARTWebSocketFactory that should be used in non-test code.

    Declaration

    Objective-C

    
    @interface ARTDefaultWebSocketFactory : NSObject <ARTWebSocketFactory>

    Swift

    class DefaultWebSocketFactory : NSObject, WebSocketFactory
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface ARTWebSocketTransport : NSObject <ARTRealtimeTransport>
    
    - (instancetype)init UNAVAILABLE_ATTRIBUTE;
    
    - (instancetype)initWithRest:(ARTRestInternal *)rest options:(ARTClientOptions *)options resumeKey:(nullable NSString *)resumeKey logger:(ARTInternalLog *)logger webSocketFactory:(id<ARTWebSocketFactory>)webSocketFactory NS_DESIGNATED_INITIALIZER;
    
    @property (readonly, nonatomic) NSString *resumeKey;
    
    @end

    Swift

    class ARTWebSocketTransport : NSObject, ARTRealtimeTransport
  • An object which wraps an instance of ARTPush and provides a similar API. It allows Ably-authored wrapper SDKs to send analytics information so that Ably can track the usage of the wrapper SDK.

    Important

    This class should only be used by Ably-authored SDKs.
    See more

    Declaration

    Objective-C

    @interface ARTWrapperSDKProxyPush : NSObject <ARTPushProtocol>

    Swift

    class ARTWrapperSDKProxyPush : NSObject, ARTPushProtocol, @unchecked Sendable
  • An object which wraps an instance of ARTPushAdmin and provides a similar API. It allows Ably-authored wrapper SDKs to send analytics information so that Ably can track the usage of the wrapper SDK.

    Important

    This class should only be used by Ably-authored SDKs.
    See more

    Declaration

    Objective-C

    @interface ARTWrapperSDKProxyPushAdmin : NSObject <ARTPushAdminProtocol>

    Swift

    class ARTWrapperSDKProxyPushAdmin : NSObject, ARTPushAdminProtocol, @unchecked Sendable
  • An object which wraps an instance of ARTPushChannel and provides a similar API. It allows Ably-authored wrapper SDKs to send analytics information so that Ably can track the usage of the wrapper SDK.

    Important

    This class should only be used by Ably-authored SDKs.
    See more

    Declaration

    Objective-C

    @interface ARTWrapperSDKProxyPushChannel : NSObject <ARTPushChannelProtocol>

    Swift

    class ARTWrapperSDKProxyPushChannel : NSObject, ARTPushChannelProtocol, @unchecked Sendable
  • An object which wraps an instance of ARTPushChannelSubscriptions and provides a similar API. It allows Ably-authored wrapper SDKs to send analytics information so that Ably can track the usage of the wrapper SDK.

    Important

    This class should only be used by Ably-authored SDKs.
    See more

    Declaration

    Objective-C

    @interface ARTWrapperSDKProxyPushChannelSubscriptions
        : NSObject <ARTPushChannelSubscriptionsProtocol>

    Swift

    class ARTWrapperSDKProxyPushChannelSubscriptions : NSObject, ARTPushChannelSubscriptionsProtocol, @unchecked Sendable
  • An object which wraps an instance of ARTPushDeviceRegistrations and provides a similar API. It allows Ably-authored wrapper SDKs to send analytics information so that Ably can track the usage of the wrapper SDK.

    Important

    This class should only be used by Ably-authored SDKs.
    See more

    Declaration

    Objective-C

    @interface ARTWrapperSDKProxyPushDeviceRegistrations
        : NSObject <ARTPushDeviceRegistrationsProtocol>

    Swift

    class ARTWrapperSDKProxyPushDeviceRegistrations : NSObject, ARTPushDeviceRegistrationsProtocol, @unchecked Sendable
  • An object which wraps an instance of ARTRealtime and provides a similar API. It allows Ably-authored wrapper SDKs to send analytics information so that Ably can track the usage of the wrapper SDK.

    Important

    This class should only be used by Ably-authored SDKs.
    See more

    Declaration

    Objective-C

    @interface ARTWrapperSDKProxyRealtime
        : NSObject <ARTRealtimeInstanceMethodsProtocol>

    Swift

    class ARTWrapperSDKProxyRealtime : NSObject, ARTRealtimeInstanceMethodsProtocol, @unchecked Sendable
  • An object which wraps an instance of ARTRealtimeAnnotations and provides a similar API. It allows Ably-authored wrapper SDKs to send analytics information so that Ably can track the usage of the wrapper SDK.

    Important

    This class should only be used by Ably-authored SDKs.
    See more

    Declaration

    Objective-C

    @interface ARTWrapperSDKProxyRealtimeAnnotations
        : NSObject <ARTRealtimeAnnotationsProtocol>

    Swift

    class ARTWrapperSDKProxyRealtimeAnnotations : NSObject, ARTRealtimeAnnotationsProtocol, @unchecked Sendable
  • An object which wraps an instance of ARTRealtimeChannel and provides a similar API. It allows Ably-authored wrapper SDKs to send analytics information so that Ably can track the usage of the wrapper SDK.

    Important

    This class should only be used by Ably-authored SDKs.
    See more

    Declaration

    Objective-C

    @interface ARTWrapperSDKProxyRealtimeChannel
        : NSObject <ARTRealtimeChannelProtocol>

    Swift

    class ARTWrapperSDKProxyRealtimeChannel : NSObject, ARTRealtimeChannelProtocol, @unchecked Sendable
  • An object which wraps an instance of ARTRealtimeChannels and provides a similar API. It allows Ably-authored wrapper SDKs to send analytics information so that Ably can track the usage of the wrapper SDK.

    Important

    This class should only be used by Ably-authored SDKs.
    See more

    Declaration

    Objective-C

    @interface ARTWrapperSDKProxyRealtimeChannels
        : NSObject <ARTRealtimeChannelsProtocol>

    Swift

    class ARTWrapperSDKProxyRealtimeChannels : NSObject, ARTRealtimeChannelsProtocol, @unchecked Sendable
  • An object which wraps an instance of ARTRealtimePresence and provides a similar API. It allows Ably-authored wrapper SDKs to send analytics information so that Ably can track the usage of the wrapper SDK.

    Important

    This class should only be used by Ably-authored SDKs.
    See more

    Declaration

    Objective-C

    @interface ARTWrapperSDKProxyRealtimePresence
        : NSObject <ARTRealtimePresenceProtocol>

    Swift

    class ARTWrapperSDKProxyRealtimePresence : NSObject, ARTRealtimePresenceProtocol, @unchecked Sendable
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface ARTSRSecurityPolicy : NSObject
    
    /**
     A default `ARTSRSecurityPolicy` implementation specifies socket security and
     validates the certificate chain.
    
     Use a subclass of `ARTSRSecurityPolicy` for more fine grained customization.
     */
    + (instancetype)defaultPolicy;
    
    /**
     Specifies socket security and provider certificate pinning, disregarding certificate
     chain validation.
    
     @param pinnedCertificates Array of `SecCertificateRef` SSL certificates to use for validation.
     */
    + (instancetype)pinnningPolicyWithCertificates:(NSArray *)pinnedCertificates
        DEPRECATED_MSG_ATTRIBUTE("Using pinned certificates is neither secure nor supported in SocketRocket, "
                                 "and leads to security issues. Please use a proper, trust chain validated certificate.");
    
    /**
     Specifies socket security and optional certificate chain validation.
    
     @param enabled Whether or not to validate the SSL certificate chain. If you
     are considering using this method because your certificate was not issued by a
     recognized certificate authority, consider using `pinningPolicyWithCertificates` instead.
     */
    - (instancetype)initWithCertificateChainValidationEnabled:(BOOL)enabled
        DEPRECATED_MSG_ATTRIBUTE("Disabling certificate chain validation is unsafe. "
                                 "Please use a proper Certificate Authority to issue your TLS certificates.")
        NS_DESIGNATED_INITIALIZER;
    
    /**
     Updates all the security options for input and output streams, for example you
     can set your socket security level here.
    
     @param stream Stream to update the options in.
     */
    - (void)updateSecurityOptionsInStream:(NSStream *)stream;
    
    /**
     Whether or not the specified server trust should be accepted, based on the security policy.
    
     This method should be used when responding to an authentication challenge from
     a server. In the default implemenation, no further validation is done here, but
     you're free to override it in a subclass. See `ARTSRPinningSecurityPolicy.h` for
     an example.
    
     @param serverTrust The X.509 certificate trust of the server.
     @param domain The domain of serverTrust.
    
     @return Whether or not to trust the server.
     */
    - (BOOL)evaluateServerTrust:(SecTrustRef)serverTrust forDomain:(NSString *)domain;
    
    @end

    Swift

    class ARTSRSecurityPolicy : NSObject
  • Contains the token string used to authenticate a client with Ably.

    See more

    Declaration

    Objective-C

    @interface ARTAuthDetails : NSObject <NSCopying>

    Swift

    class ARTAuthDetails : NSObject, NSCopying
  • Provides information about the Ably client library and the environment in which it’s running.

    See more

    Declaration

    Objective-C

    @interface ARTClientInformation : NSObject

    Swift

    class ARTClientInformation : NSObject
  • Contains an individual message that is sent to, or received from, Ably.

    See more

    Declaration

    Objective-C

    @interface ARTMessage : ARTBaseMessage

    Swift

    class ARTMessage : ARTBaseMessage
  • Contains the subscriptions of a device, or a group of devices sharing the same clientId, has to a channel in order to receive push notifications.

    See more

    Declaration

    Objective-C

    @interface ARTPushChannelSubscription : NSObject

    Swift

    class ARTPushChannelSubscription : NSObject
  • Describes the properties of the channel state.

    See more

    Declaration

    Objective-C

    @interface ARTChannelProperties : NSObject

    Swift

    class ARTChannelProperties : NSObject
  • Passes additional properties to an ARTRealtimeChannel object, such as encryption, an ARTChannelMode and channel parameters.

    See more

    Declaration

    Objective-C

    @interface ARTRealtimeChannelOptions : ARTChannelOptions

    Swift

    class ARTRealtimeChannelOptions : ARTChannelOptions
  • This object is used for providing parameters into ARTRealtimePresence‘s methods with paginated results.

    See more

    Declaration

    Objective-C

    @interface ARTRealtimePresenceQuery : ARTPresenceQuery

    Swift

    class ARTRealtimePresenceQuery : ARTPresenceQuery
  • This object is used for providing parameters into ARTStats‘s methods with paginated results.

    See more

    Declaration

    Objective-C

    @interface ARTStatsQuery : ARTDataQuery

    Swift

    class ARTStatsQuery : ARTDataQuery
  • Contains the aggregate counts for messages and data transferred.

    See more

    Declaration

    Objective-C

    @interface ARTStatsMessageCount : NSObject

    Swift

    class ARTStatsMessageCount : NSObject
  • Contains a breakdown of summary stats data for different (channel vs presence) message types.

    See more

    Declaration

    Objective-C

    @interface ARTStatsMessageTypes : NSObject

    Swift

    class ARTStatsMessageTypes : NSObject
  • Contains a breakdown of summary stats data for traffic over various transport types.

    See more

    Declaration

    Objective-C

    @interface ARTStatsMessageTraffic : NSObject

    Swift

    class ARTStatsMessageTraffic : NSObject
  • Contains the aggregate data for usage of a resource in a specific scope.

    See more

    Declaration

    Objective-C

    @interface ARTStatsResourceCount : NSObject

    Swift

    class ARTStatsResourceCount : NSObject
  • Contains a breakdown of summary stats data for different (TLS vs non-TLS) connection types.

    See more

    Declaration

    Objective-C

    @interface ARTStatsConnectionTypes : NSObject

    Swift

    class ARTStatsConnectionTypes : NSObject
  • Contains the aggregate counts for requests made.

    See more

    Declaration

    Objective-C

    @interface ARTStatsRequestCount : NSObject

    Swift

    class ARTStatsRequestCount : NSObject
  • Details the stats on push notifications.

    See more

    Declaration

    Objective-C

    @interface ARTStatsPushCount : NSObject

    Swift

    class ARTStatsPushCount : NSObject
  • Contains application statistics for a specified time interval and time period.

    See more

    Declaration

    Objective-C

    @interface ARTStats : NSObject

    Swift

    class ARTStats : NSObject
  • A generic Ably error object that contains an Ably-specific status code, and a generic status code. Errors returned from the Ably server are compatible with the ARTErrorInfo structure and should result in errors that inherit from ARTErrorInfo.

    See

    For possible NSError.code see Ably error codes.
    See more

    Declaration

    Objective-C

    @interface ARTErrorInfo : NSError

    Swift

    class ARTErrorInfo : NSError
  • Contains an Ably Token and its associated metadata.

    See more

    Declaration

    Objective-C

    @interface ARTTokenDetails : NSObject <NSCopying>

    Swift

    class ARTTokenDetails : NSObject, NSCopying
  • Contains the properties of a request for a token to Ably. Tokens are generated using -[ARTAuthProtocol requestToken:].

    See more

    Declaration

    Objective-C

    @interface ARTTokenRequest : NSObject

    Swift

    class ARTTokenRequest : NSObject
  • Contains the metrics associated with a ARTRestChannel or ARTRealtimeChannel, such as the number of publishers, subscribers and connections it has.

    See more

    Declaration

    Objective-C

    @interface ARTChannelMetrics : NSObject

    Swift

    class ARTChannelMetrics : NSObject, @unchecked Sendable
  • Contains the metrics of a ARTRestChannel or ARTRealtimeChannel object.

    See more

    Declaration

    Objective-C

    @interface ARTChannelOccupancy : NSObject

    Swift

    class ARTChannelOccupancy : NSObject, @unchecked Sendable
  • Contains the status of a ARTRestChannel or ARTRealtimeChannel object such as whether it is active and its ARTChannelOccupancy.

    See more

    Declaration

    Objective-C

    @interface ARTChannelStatus : NSObject

    Swift

    class ARTChannelStatus : NSObject, @unchecked Sendable
  • Contains the details of a ARTRestChannel or ARTRealtimeChannel object such as its ID and ARTChannelStatus.

    See more

    Declaration

    Objective-C

    @interface ARTChannelDetails : NSObject

    Swift

    class ARTChannelDetails : NSObject, @unchecked Sendable
  • A set of options for controlling the creation of an ARTWrapperSDKProxyRealtime object.

    See more

    Declaration

    Objective-C

    @interface ARTWrapperSDKProxyOptions : NSObject

    Swift

    class ARTWrapperSDKProxyOptions : NSObject, @unchecked Sendable