Protocols
The following protocols are available globally.
-
Messages related to the ARTAuth
See moreDeclaration
Objective-C
@protocol ARTAuthDelegate <NSObject>
Swift
protocol ARTAuthDelegate : NSObjectProtocol
-
Undocumented
See moreDeclaration
Objective-C
@protocol ARTChannelsDelegate <NSObject> - (id)makeChannel:(NSString *)channel options:(nullable ARTChannelOptions *)options; @end
Swift
protocol ARTChannelsDelegate : NSObjectProtocol
-
Undocumented
See moreDeclaration
Objective-C
@protocol ARTChannelCipher - (ARTStatus *)encrypt:(NSData *)plaintext output:(NSData *_Nullable *_Nullable)output; - (ARTStatus *)decrypt:(NSData *)ciphertext output:(NSData *_Nullable *_Nullable)output; - (nullable NSString *)cipherName; - (size_t) keyLength; @end
Swift
protocol ARTChannelCipher
-
Checks an
ARTErrorInfo
to see whether it falls into a given class of errors defined by the client library specification.In addition to putting shared error logic in a common place, it allows us to provide a mock instance when testing components that need to perform error checking, without having to worry about creating representative errors in our test cases.
See moreDeclaration
Objective-C
@protocol ARTErrorChecker
Swift
protocol ErrorChecker
-
ARTInternalLogCore
is the type underlyingARTInternalLog
, and defines the logging functionality available to components of the SDK.It’s responsible for receiving log messages from SDK components, performing additional processing on these messages, and forwarding the result to an object conforming to the
ARTVersion2Log
protocol.This protocol exists to give internal SDK components access to a rich and useful logging interface, whilst minimising the complexity (and hence the implementation burden for users of the SDK) of the
ARTVersion2Log
protocol. It also allows us to evolve the logging interface used internally without introducing breaking changes for users of the SDK.The initial interface of
See moreARTInternalLogCore
more or less mirrors that of theARTLog
class, for compatibility with existing internal SDK code. However, it will evolve as we gather requirements for the information logged by the SDK — see issues #1623 and #1624.Declaration
Objective-C
@protocol ARTInternalLogCore <NSObject>
Swift
protocol InternalLogCore : NSObjectProtocol
-
An object which generates the random “jitter coefficient” used to determine when the library will next retry an operation.
See moreDeclaration
Objective-C
@protocol ARTJitterCoefficientGenerator
Swift
protocol JitterCoefficientGenerator
-
Undocumented
See moreDeclaration
Objective-C
@protocol ARTJsonLikeEncoderDelegate <NSObject> - (NSString *)mimeType; - (ARTEncoderFormat)format; - (NSString *)formatAsString; - (nullable id)decode:(NSData *)data error:(NSError * _Nullable __autoreleasing * _Nullable)error; - (nullable NSData *)encode:(id)obj error:(NSError * _Nullable __autoreleasing * _Nullable)error; @end
Swift
protocol ARTJsonLikeEncoderDelegate : NSObjectProtocol
-
Undocumented
See moreDeclaration
Objective-C
@protocol ARTReachability <NSObject> - (instancetype)initWithLogger:(ARTInternalLog *)logger queue:(dispatch_queue_t)queue; - (void)listenForHost:(NSString *)host callback:(void (^)(BOOL))callback; - (void)off; @end
Swift
protocol ARTReachability : NSObjectProtocol
-
Undocumented
See moreDeclaration
Objective-C
@protocol ARTRealtimeTransportDelegate // All methods must be called from rest's serial queue. - (void)realtimeTransport:(id<ARTRealtimeTransport>)transport didReceiveMessage:(ARTProtocolMessage *)message; - (void)realtimeTransportAvailable:(id<ARTRealtimeTransport>)transport; - (void)realtimeTransportClosed:(id<ARTRealtimeTransport>)transport; - (void)realtimeTransportDisconnected:(id<ARTRealtimeTransport>)transport withError:(nullable ARTRealtimeTransportError *)error; - (void)realtimeTransportNeverConnected:(id<ARTRealtimeTransport>)transport; - (void)realtimeTransportRefused:(id<ARTRealtimeTransport>)transport withError:(nullable ARTRealtimeTransportError *)error; - (void)realtimeTransportTooBig:(id<ARTRealtimeTransport>)transport; - (void)realtimeTransportFailed:(id<ARTRealtimeTransport>)transport withError:(ARTRealtimeTransportError *)error; - (void)realtimeTransportSetMsgSerial:(id<ARTRealtimeTransport>)transport msgSerial:(int64_t)msgSerial; @end
Swift
protocol ARTRealtimeTransportDelegate
-
Undocumented
See moreDeclaration
Objective-C
@protocol ARTRealtimeTransport // All methods must be called from rest's serial queue. @property (readonly, nonatomic) NSString *resumeKey; @property (readonly, nonatomic) ARTRealtimeTransportState state; @property (nullable, readwrite, nonatomic) id<ARTRealtimeTransportDelegate> delegate; @property (nonatomic, readonly) ARTEventEmitter<ARTEvent *, id> *stateEmitter; - (BOOL)send:(NSData *)data withSource:(nullable id)decodedObject; - (void)receive:(ARTProtocolMessage *)msg; - (nullable ARTProtocolMessage *)receiveWithData:(NSData *)data; - (void)connectWithKey:(NSString *)key; - (void)connectWithToken:(NSString *)token; - (void)sendClose; - (void)sendPing; - (void)close; - (void)abort:(ARTStatus *)reason; - (NSString *)host; - (void)setHost:(NSString *)host; - (ARTRealtimeTransportState)state; @end
Swift
protocol ARTRealtimeTransport
-
A factory for creating an
See moreARTRealtimeTransport
instance.Declaration
Objective-C
@protocol ARTRealtimeTransportFactory
Swift
protocol RealtimeTransportFactory
-
Consider an operation which can fail. If we attempt to perform the operation and it fails, we may wish to start performing a sequence of retries, until success or some other termination condition is achieved. An
See moreARTRetryDelayCalculator
describes the amount of time that we wish to wait before performing each retry in this sequence.Declaration
Objective-C
@protocol ARTRetryDelayCalculator
Swift
protocol RetryDelayCalculator
-
Undocumented
See moreDeclaration
Objective-C
@protocol ARTURLSession <NSObject> @property (readonly) dispatch_queue_t queue; - (instancetype)init:(dispatch_queue_t)queue; - (NSObject<ARTCancellable> *)get:(NSURLRequest *)request completion:(ARTURLRequestCallback)callback; - (void)finishTasksAndInvalidate; @end
Swift
protocol ARTURLSession : NSObjectProtocol
-
The
ARTVersion2Log
protocol represents a logger object that handles data emitted by the SDK’s logging system. It will be renamedARTLog
in the next major release of the SDK (replacing the existing class), at which point users of the SDK will need to provide an implementation of this protocol if they wish to replace the SDK’s default logger.The initial interface of
ARTVersion2Log
is based on that of theARTLog
class. However, its design will evolve as we gather further information about the following things:Requirements for the information logged by the SDK — see issues #1623 and #1624.
Requirements for the data emitted by the SDK’s logging system — see issues #1618 and #1625.
Declaration
Objective-C
@protocol ARTVersion2Log <NSObject>
Swift
protocol Version2Log : NSObjectProtocol
-
This protocol has the subset of ARTSRWebSocket we actually use.
See moreDeclaration
Objective-C
@protocol ARTWebSocket <NSObject>
Swift
protocol ARTWebSocket : NSObjectProtocol
-
The
ARTWebSocketDelegate
protocol describes the methods thatARTWebSocket
objects call on their delegates to handle status and messsage events.This protocol was previously in the SocketRocket library and named ARTSRWebSocketDelegate; all documentation comments have been copied verbatim.
See moreDeclaration
Objective-C
@protocol ARTWebSocketDelegate <NSObject>
Swift
protocol ARTWebSocketDelegate : NSObjectProtocol
-
A factory for creating an
See moreARTWebSocket
object.Declaration
Objective-C
@protocol ARTWebSocketFactory
Swift
protocol WebSocketFactory
-
The protocol upon which
See moreARTRestChannelProtocol
andARTRealtimeChannelProtocol
are based.Declaration
Objective-C
@protocol ARTChannelProtocol
Swift
protocol ARTChannelProtocol
-
The protocol upon which the
See moreARTConnection
is implemented. Also embedsARTEventEmitter
.Declaration
Objective-C
@protocol ARTConnectionProtocol <NSObject>
Swift
protocol ARTConnectionProtocol : NSObjectProtocol
-
The interface for handling Push activation/deactivation-related actions.
See moreDeclaration
Objective-C
@protocol ARTPushRegistererDelegate
Swift
protocol ARTPushRegistererDelegate
-
The protocol upon which the
See moreARTPushAdmin
is implemented.Declaration
Objective-C
@protocol ARTPushAdminProtocol
Swift
protocol ARTPushAdminProtocol
-
The protocol upon which the
See moreARTPushChannel
is implemented.Declaration
Objective-C
@protocol ARTPushChannelProtocol
Swift
protocol ARTPushChannelProtocol
-
The protocol upon which the
See moreARTPushChannelSubscriptions
is implemented.Declaration
Objective-C
@protocol ARTPushChannelSubscriptionsProtocol
Swift
protocol ARTPushChannelSubscriptionsProtocol
-
The protocol upon which the
See moreARTPushDeviceRegistrations
is implemented.Declaration
Objective-C
@protocol ARTPushDeviceRegistrationsProtocol
Swift
protocol ARTPushDeviceRegistrationsProtocol
-
This protocol contains the non-initializer instance methods provided by the
See moreARTRealtime
client class.Declaration
Objective-C
@protocol ARTRealtimeInstanceMethodsProtocol <NSObject>
Swift
protocol ARTRealtimeInstanceMethodsProtocol : NSObjectProtocol
-
The protocol upon which the top level object
See moreARTRealtime
is implemented.Declaration
Objective-C
@protocol ARTRealtimeProtocol <ARTRealtimeInstanceMethodsProtocol>
Swift
protocol ARTRealtimeProtocol : ARTRealtimeInstanceMethodsProtocol
-
The protocol upon which the
See moreARTRealtimeAnnotations
is implemented.Declaration
Objective-C
@protocol ARTRealtimeAnnotationsProtocol
Swift
protocol ARTRealtimeAnnotationsProtocol
-
The protocol upon which the
See moreARTRealtimeChannel
is implemented. Also embedsARTEventEmitter
.Declaration
Objective-C
@protocol ARTRealtimeChannelProtocol <ARTChannelProtocol>
Swift
protocol ARTRealtimeChannelProtocol : ARTChannelProtocol
-
The protocol upon which the
See moreARTRealtimePresence
is implemented.Declaration
Objective-C
@protocol ARTRealtimePresenceProtocol
Swift
protocol ARTRealtimePresenceProtocol
-
Declaration
Objective-C
@protocol ARTRestProtocol <ARTRestInstanceMethodsProtocol>
Swift
protocol ARTRestProtocol : ARTRestInstanceMethodsProtocol
-
The protocol upon which the
See moreARTRestChannel
is implemented.Declaration
Objective-C
@protocol ARTRestChannelProtocol <ARTChannelProtocol>
Swift
protocol ARTRestChannelProtocol : ARTChannelProtocol
-
The protocol upon which the
See moreARTRestPresence
is implemented.Declaration
Objective-C
@protocol ARTRestPresenceProtocol
Swift
protocol ARTRestPresenceProtocol