ARTWebSocketTransport

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

Undocumented

  • Unavailable

    Undocumented

    Declaration

    Objective-C

    - (instancetype)init UNAVAILABLE_ATTRIBUTE;
  • Undocumented

    Declaration

    Objective-C

    - (instancetype)initWithRest:(ARTRestInternal *)rest options:(ARTClientOptions *)options resumeKey:(nullable NSString *)resumeKey logger:(ARTInternalLog *)logger webSocketFactory:(id<ARTWebSocketFactory>)webSocketFactory NS_DESIGNATED_INITIALIZER;

    Swift

    init(rest: ARTRestInternal, options: ARTClientOptions, resumeKey: String?, logger: InternalLog, webSocketFactory: any WebSocketFactory)
  • Undocumented

    Declaration

    Objective-C

    @property (readonly, nonatomic) NSString *resumeKey

    Swift

    var resumeKey: String { get }
  • Undocumented

    Declaration

    Objective-C

    @property (nonatomic) id<ARTEncoder> encoder

    Swift

    var encoder: any ARTEncoder { get set }
  • Undocumented

    Declaration

    Objective-C

    @property (readonly, nonatomic) ARTInternalLog *logger

    Swift

    var logger: InternalLog { get }
  • Undocumented

    Declaration

    Objective-C

    @property (readonly, nonatomic) ARTClientOptions *options

    Swift

    var options: ARTClientOptions { get }
  • Undocumented

    Declaration

    Objective-C

    @property (nonatomic, nullable) id<ARTWebSocket> websocket

    Swift

    var websocket: (any ARTWebSocket)? { get set }
  • Undocumented

    Declaration

    Objective-C

    @property (nonatomic, nullable) NSURL *websocketURL

    Swift

    var websocketURL: URL? { get set }
  • Undocumented

    Declaration

    Objective-C

    - (NSURL *)setupWebSocket:(NSDictionary<NSString *, NSURLQueryItem *> *)params withOptions:(ARTClientOptions *)options resumeKey:(NSString *_Nullable)resumeKey;

    Swift

    func setupWebSocket(_ params: [String : URLQueryItem], with options: ARTClientOptions, resumeKey: String?) -> URL
  • Undocumented

    Declaration

    Objective-C

    - (void)setState:(ARTRealtimeTransportState)state;

    Swift

    func setState(_ state: ARTRealtimeTransportState)
  • This is called as a result of a call to -connectWithToken: or -connectWithKey:. It calls (asynchronously on a queue internal to this transport) -open on the underlying ARTWebSocket.

    Exposed so that test subclasses can override and replace or wrap in additional logic.

    Declaration

    Objective-C

    - (void)openWebSocket;

    Swift

    func openWebSocket()