Skip to content

Swift client to communicate with Centrifugo from iOS over SwiftWebSocket

License

Notifications You must be signed in to change notification settings

muszu/centrifuge-ios

 
 

Repository files navigation

CentrifugeiOS

Build Status Version License Platform

Example

To run the example project, clone the repo, and run pod install from the Example directory first. You could chat with here and command from Centrifugal web

Usage

Create client:

let timestamp = "\(Int(NSDate().timeIntervalSince1970))"

let creds = CentrifugeCredentials(secret: secret, user: user, timestamp: timestamp)
let url = "wss://centrifugo.herokuapp.com/connection/websocket"
client = Centrifuge.client(url, creds: creds, delegate: self)

Connect to server:

client.connect { message, error in }

Subscribe to channel:

client.subscribe(channel, delegate: delegate) { message, error in }

Publish:

client.publish(channel, data:  data) { message, error in }

See the example project and docs for more information.

Requirements

Swift 2.2 iOS 8.0+

Installation

CentrifugeiOS is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "CentrifugeiOS"

Author

Herman Saprykin, [email protected]

License

CentrifugeiOS is available under the MIT license. See the LICENSE file for more info.

About

Swift client to communicate with Centrifugo from iOS over SwiftWebSocket

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Swift 97.7%
  • Ruby 2.3%