Skip to content
Branch: master
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
Sources
README.md

README.md

SKClient

Create a custom SlackKit client.

Installation

Swift Package Manager Add SlackKit as a dependency to your Package.swift and specify SKClient as a target dependency:
import PackageDescription
  
let package = Package(
    name: "SampleApp",
    products: [
        .executable(
            name: "SampleApp",
            targets: ["SampleApp"]),
    ],
    dependencies: [
        .package(url: "https://github.com/pvzig/SlackKit.git", .upToNextMinor(from: "4.3.0")),
    ],
    targets: [
        .target(
            name: "SampleApp",
            dependencies: ["SKClient"])
    ]
)
Carthage Add SlackKit to your Cartfile:
github "pvzig/SlackKit"

and run

carthage bootstrap

Drag the built SKClient.framework and it's dependency SKCore.framework into your Xcode project.

CocoaPods Add SKClient to your Podfile:
use_frameworks!
pod 'SlackKit/SKClient'

Usage

To use the library in your project import it:

Carthage & SPM

import SKClient

CocoaPods

import SlackKit

The Basics

Subclass Client to create a custom SlackKit client.

class MyClient: Client {

    override func notificationForEvent(_ event: Event, type: EventType) {
    …
    }

	override func initialSetup(JSON: [String: Any]) {
	…
	}
}

Pass your custom client to SlackKit when adding an RTM bot:

let bot = SlackKit()
bot.addRTMBotWithAPIToken(“xoxb-SLACK_AUTH_TOKEN”, client: MyClient())
You can’t perform that action at this time.