Skip to content

Swift client library for the traQ Websocket API.

Notifications You must be signed in to change notification settings

ras0q/swift-traq-ws

Repository files navigation

swift-traq-ws

Swift client library for the traQ Websocket API.

Please install this package by SPM.

Example

import TraqWebsocket

// in function...
let wsClient = WsClient()

// register process on specific event
wsClient.onEvent(type: .messageRead) { event in
    // aquire payload struct
    guard case let .messageRead(payload) = event.body else {
        return
    }

    print("receive \(event.type) event: \(payload)")
}

// connect
wsClient.resume()

About

Swift client library for the traQ Websocket API.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages