Latest 2.0.0
Homepage https://github.com/matrix-io/matrix-streaming-swift-sdk
License MIT
Platforms ios 8.0, osx 10.10, tvos 9.0
Dependencies MatrixUtils, Socket.IO-Client-Swift

MATRIX Swift Streaming SDK

MATRIX Streaming server framework for Swift

Build Status
CocoaPods Compatible
License
Platform
Swift

Requirements

  • iOS 8.0+
  • Xcode 8.1, 8.2, 8.3
  • Swift 3.0, 3.1, 3.2

Installation

CocoaPods

To integrate MATRIX Streaming SDK into your Xcode project using CocoaPods, specify it in your Podfile:

$ pod 'MatrixStreamimgSDK'

Then, run the following command:

$ pod install

Usage

The starting point is MXSSConnection. With it you can:

  • Connect to MATRIX Straming Server.
  • Authenticate an existing user and work with it.
  • Receive messages from a MATRIX device.
  • Send events to a MATRIX device.

Connect to MATRIX Streaming Server

let mxssConnection = try MXSSConnection(env: ..., userId: ..., userToken: ..., debug: ...)
mxssConnection?.delegate = self
mxssConnection?.startConnection()

Start an app

let message = ["channel": MXSSEvent.clientCommand,
               "payload": ["t": MXSSCommand.appStart,
                           "deviceId": ...,
                           "p": ["name": /*appName*/,
                                 "token": /*userToken*/]]] as [String : Any]
mxssConnection.sendMessage(message)

Stop an app

let message = ["channel": MXSSEvent.clientCommand,
               "payload": ["t": MXSSCommand.appStop,
                           "deviceId": ...,
                           "p": ["name": /*appName*/,
                                 "token": /*userToken*/]]] as [String : Any]
mxssConnection.sendMessage(message)

License

This project is released under the MIT License.

Latest podspec

{
    "name": "MatrixStreamingSDK",
    "version": "2.0.0",
    "summary": "MATRIX Streaming SDK for Swift.",
    "homepage": "https://github.com/matrix-io/matrix-streaming-swift-sdk",
    "license": {
        "type": "MIT",
        "file": "LICENSE.md"
    },
    "authors": "MATRIX Labs",
    "social_media_url": "https://twitter.com/MATRIX_Creator",
    "platforms": {
        "ios": "8.0",
        "osx": "10.10",
        "tvos": "9.0"
    },
    "source": {
        "git": "https://github.com/matrix-io/matrix-streaming-swift-sdk.git",
        "tag": "v2.0.0"
    },
    "source_files": "Sources/**/*.swift",
    "dependencies": {
        "MatrixUtils": [],
        "Socket.IO-Client-Swift": [
            "~> 12.1.0"
        ]
    },
    "pushed_with_swift_version": "4.0"
}

Pin It on Pinterest

Share This