Latest 3.1.0
Homepage https://github.com/centrifugal/centrifuge-ios
License MIT
Platforms ios 9.3
Dependencies SwiftWebSocket, IDZSwiftCommonCrypto
Authors

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(Date().timeIntervalSince1970))"
let token =  Centrifuge.createToken(string: "(user)(timestamp)", key: secret)

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

Connect to server:

client.connect { message, error in }

Subscribe to channel:

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

Publish:

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

See the example project and docs for more information.

Requirements

  • Version 0.1.0: Swift 2.2, iOS 8.0+
  • Version 1.0.0: Swift 2.3, iOS 8.0+, Xcode 7
  • Version 2.0.0: Swift 2.3, iOS 9.3+, Xcode 8
  • Version 3.0.0: Swift 3.0, iOS 9.3+, Xcode 8

Installation

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

pod "CentrifugeiOS"

Author

German Saprykin, [email protected]

License

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

Latest podspec

{
    "name": "CentrifugeiOS",
    "version": "3.1.0",
    "summary": "Swifty iOS client for Centrifuge.",
    "description": "iOS client for Centrifuge https://github.com/centrifugal/Centrifuge. It uses SwiftWebSocket and helpers classes to communicate with Centrifuge server.",
    "homepage": "https://github.com/centrifugal/centrifuge-ios",
    "license": "MIT",
    "authors": {
        "German Saprykin": "[email protected]"
    },
    "source": {
        "git": "https://github.com/centrifugal/centrifuge-ios.git",
        "tag": "3.1.0"
    },
    "social_media_url": "https://twitter.com/saprykinh",
    "platforms": {
        "ios": "9.3"
    },
    "source_files": "CentrifugeiOS/Classes/**/*",
    "dependencies": {
        "SwiftWebSocket": [
            "~>2.6.0"
        ],
        "IDZSwiftCommonCrypto": [
            "~>0.9.0"
        ]
    },
    "pushed_with_swift_version": "3.0"
}

Pin It on Pinterest

Share This