@objcMembers
@objc
open class Pusher : NSObject
Undocumented
Initializes the Pusher client with an app key and any appropriate options.
Parameters key
The Pusher app key
options
An optional collection of options
Return ValueA new Pusher client instance
Subscribes the client to a new channel
Parameters channelName
The name of the channel to subscribe to
auth
A PusherAuth value if subscription is being made to an authenticated channel without using the default auth methods
onMemberAdded
A function that will be called with information about the member who has just joined the presence channel
onMemberRemoved
A function that will be called with information about the member who has just left the presence channel
Return ValueA new PusherChannel instance
Subscribes the client to a new presence channel. Use this instead of the subscribe function when you want a presence channel object to be returned instead of just a generic channel object (which you can then cast)
Parameters channelName
The name of the channel to subscribe to
auth
A PusherAuth value if subscription is being made to an authenticated channel without using the default auth methods
onMemberAdded
A function that will be called with information about the member who has just joined the presence channel
onMemberRemoved
A function that will be called with information about the member who has just left the presence channel
Return ValueA new PusherPresenceChannel instance
Unsubscribes the client from a given channel
DeclarationSwift
open func unsubscribe(_ channelName: String)
Parameters channelName
The name of the channel to unsubscribe from
Unsubscribes the client from all channels
DeclarationSwift
open func unsubscribeAll()
Binds the client’s global channel to all events
DeclarationSwift
@discardableResult
open func bind(eventCallback: @escaping (PusherEvent) -> Void) -> String
Parameters eventCallback
The function to call when a new event is received. The callback receives a PusherEvent, containing the event’s data payload and other properties.
Return ValueA unique string that can be used to unbind the callback from the client
Unbinds the client from its global channel
DeclarationSwift
open func unbind(callbackId: String)
Parameters callbackId
The unique callbackId string used to identify which callback to unbind
Unbinds the client from all global callbacks
DeclarationSwift
open func unbindAll()
Disconnects the client’s connection
DeclarationSwift
open func disconnect()
Initiates a connection attempt using the client’s existing connection details
DeclarationSwift
open func connect()
Undocumented
DeclarationSwift
convenience init(withKey key: String)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4