SKYPubsubContainer

@interface SKYPubsubContainer : NSObject

Undocumented

  • Undocumented

    Declaration

    Objective-C

    @property (nonatomic, weak) id<SKYPubsubContainerDelegate> _Nullable delegate

    Swift

    weak var delegate: SKYPubsubContainerDelegate? { get set }
  • Undocumented

    Declaration

    Objective-C

    @property (nonatomic, copy, readonly, nullable) NSURL *endPointAddress

    Swift

    var endPointAddress: URL? { get }
  • Gets or sets whether the internal pubsub connection is configured to connect automatically.

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic) BOOL autoInternalPubsub;

    Swift

    var autoInternalPubsub: Bool { get set }
  • Manually connect to the pubsub end-point without subscribing a channel. Normally, you can just

    Declaration

    Objective-C

    - (void)connect;

    Swift

    func connect()
  • Manually close pubsub conenction and unsubscribe everthings.

    Declaration

    Objective-C

    - (void)close;

    Swift

    func close()
  • Subscribe to channel with the messageHandler block. Each channel can only have one messageHandler.

    Declaration

    Objective-C

    - (void)subscribeTo:(nonnull NSString *)channel
                handler:(nonnull void (^)(NSDictionary *_Nonnull))messageHandler;

    Swift

    func subscribe(to channel: String, handler messageHandler: @escaping ([AnyHashable : Any]) -> Void)
  • Unscubscribe a channel without closing connection.

    Declaration

    Objective-C

    - (void)unsubscribe:(nonnull NSString *)channel;

    Swift

    func unsubscribe(_ channel: String)
  • Publish message to a channel.

    Declaration

    Objective-C

    - (void)publishMessage:(nonnull NSDictionary *)message
                 toChannel:(nonnull NSString *)channel;

    Swift

    func publishMessage(_ message: [AnyHashable : Any], toChannel channel: String)