Protocols

The following protocols are available globally.

  • Messages related to the ARTAuth

    See more

    Declaration

    Objective-C

    @protocol ARTAuthDelegate <NSObject>

    Swift

    protocol ARTAuthDelegate : NSObjectProtocol
  • Undocumented

    See more

    Declaration

    Objective-C

    @protocol ARTChannelsDelegate <NSObject>
    
    - (id)makeChannel:(NSString *)channel options:(nullable ARTChannelOptions *)options;
    
    @end

    Swift

    protocol ARTChannelsDelegate : NSObjectProtocol
  • Undocumented

    See more

    Declaration

    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 more

    Declaration

    Objective-C

    @protocol ARTErrorChecker

    Swift

    protocol ErrorChecker
  • ARTInternalLogCore is the type underlying ARTInternalLog, 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 ARTInternalLogCore more or less mirrors that of the ARTLog 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.

    See more

    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 more

    Declaration

    Objective-C

    @protocol ARTJitterCoefficientGenerator

    Swift

    protocol JitterCoefficientGenerator
  • Undocumented

    See more

    Declaration

    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 more

    Declaration

    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 more

    Declaration

    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 more

    Declaration

    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 ARTRealtimeTransport instance.

    See more

    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 ARTRetryDelayCalculator describes the amount of time that we wish to wait before performing each retry in this sequence.

    See more

    Declaration

    Objective-C

    @protocol ARTRetryDelayCalculator

    Swift

    protocol RetryDelayCalculator
  • Undocumented

    See more

    Declaration

    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 renamed ARTLog 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 the ARTLog class. However, its design will evolve as we gather further information about the following things:

    1. Requirements for the information logged by the SDK — see issues #1623 and #1624.

    2. Requirements for the data emitted by the SDK’s logging system — see issues #1618 and #1625.

    See more

    Declaration

    Objective-C

    @protocol ARTVersion2Log <NSObject>

    Swift

    protocol Version2Log : NSObjectProtocol
  • This protocol has the subset of ARTSRWebSocket we actually use.

    See more

    Declaration

    Objective-C

    @protocol ARTWebSocket <NSObject>

    Swift

    protocol ARTWebSocket : NSObjectProtocol
  • The ARTWebSocketDelegate protocol describes the methods that ARTWebSocket 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 more

    Declaration

    Objective-C

    @protocol ARTWebSocketDelegate <NSObject>

    Swift

    protocol ARTWebSocketDelegate : NSObjectProtocol
  • A factory for creating an ARTWebSocket object.

    See more

    Declaration

    Objective-C

    @protocol ARTWebSocketFactory

    Swift

    protocol WebSocketFactory
  • The protocol upon which the ARTAuth is implemented.

    See more

    Declaration

    Objective-C

    @protocol ARTAuthProtocol

    Swift

    protocol ARTAuthProtocol
  • The protocol upon which ARTRestChannelProtocol and ARTRealtimeChannelProtocol are based.

    See more

    Declaration

    Objective-C

    @protocol ARTChannelProtocol

    Swift

    protocol ARTChannelProtocol
  • The protocol upon which the ARTConnection is implemented. Also embeds ARTEventEmitter.

    See more

    Declaration

    Objective-C

    @protocol ARTConnectionProtocol <NSObject>

    Swift

    protocol ARTConnectionProtocol : NSObjectProtocol
  • The interface for handling Push activation/deactivation-related actions.

    See more

    Declaration

    Objective-C

    @protocol ARTPushRegistererDelegate

    Swift

    protocol ARTPushRegistererDelegate
  • The protocol upon which the ARTPush is implemented.

    See more

    Declaration

    Objective-C

    @protocol ARTPushProtocol

    Swift

    protocol ARTPushProtocol
  • The protocol upon which the ARTPushAdmin is implemented.

    See more

    Declaration

    Objective-C

    @protocol ARTPushAdminProtocol

    Swift

    protocol ARTPushAdminProtocol
  • The protocol upon which the ARTPushChannel is implemented.

    See more

    Declaration

    Objective-C

    @protocol ARTPushChannelProtocol

    Swift

    protocol ARTPushChannelProtocol
  • The protocol upon which the ARTPushChannelSubscriptions is implemented.

    See more

    Declaration

    Objective-C

    @protocol ARTPushChannelSubscriptionsProtocol

    Swift

    protocol ARTPushChannelSubscriptionsProtocol
  • The protocol upon which the ARTPushDeviceRegistrations is implemented.

    See more

    Declaration

    Objective-C

    @protocol ARTPushDeviceRegistrationsProtocol

    Swift

    protocol ARTPushDeviceRegistrationsProtocol
  • This protocol contains the non-initializer instance methods provided by the ARTRealtime client class.

    See more

    Declaration

    Objective-C

    @protocol ARTRealtimeInstanceMethodsProtocol <NSObject>

    Swift

    protocol ARTRealtimeInstanceMethodsProtocol : NSObjectProtocol
  • The protocol upon which the top level object ARTRealtime is implemented.

    See more

    Declaration

    Objective-C

    @protocol ARTRealtimeProtocol <ARTRealtimeInstanceMethodsProtocol>

    Swift

    protocol ARTRealtimeProtocol : ARTRealtimeInstanceMethodsProtocol
  • The protocol upon which the ARTRealtimeAnnotations is implemented.

    See more

    Declaration

    Objective-C

    @protocol ARTRealtimeAnnotationsProtocol

    Swift

    protocol ARTRealtimeAnnotationsProtocol
  • The protocol upon which the ARTRealtimeChannel is implemented. Also embeds ARTEventEmitter.

    See more

    Declaration

    Objective-C

    @protocol ARTRealtimeChannelProtocol <ARTChannelProtocol>

    Swift

    protocol ARTRealtimeChannelProtocol : ARTChannelProtocol
  • The protocol upon which the ARTRealtimePresence is implemented.

    See more

    Declaration

    Objective-C

    @protocol ARTRealtimePresenceProtocol

    Swift

    protocol ARTRealtimePresenceProtocol
  • This protocol contains the non-initializer instance methods provided by the ARTRest client class.

    See more

    Declaration

    Objective-C

    @protocol ARTRestInstanceMethodsProtocol <NSObject>

    Swift

    protocol ARTRestInstanceMethodsProtocol : NSObjectProtocol
  • The protocol upon which the top level object ARTRest is implemented.

    See more

    Declaration

    Objective-C

    @protocol ARTRestProtocol <ARTRestInstanceMethodsProtocol>

    Swift

    protocol ARTRestProtocol : ARTRestInstanceMethodsProtocol
  • The protocol upon which the ARTRestChannel is implemented.

    See more

    Declaration

    Objective-C

    @protocol ARTRestChannelProtocol <ARTChannelProtocol>

    Swift

    protocol ARTRestChannelProtocol : ARTChannelProtocol
  • The protocol upon which the ARTRestPresence is implemented.

    See more

    Declaration

    Objective-C

    @protocol ARTRestPresenceProtocol

    Swift

    protocol ARTRestPresenceProtocol