SwiftBlocksUI is a way to write interactive Slack messages and modal dialogs (also known as Slack "applications") using a SwiftUI like declarative style.
Explained in blog article/tutorial: Instant “SwiftUI” Flavoured Slack Apps.
This repository is a development testbed, containing all the other example apps.
This requires a Slack bot authentication token, which can be found on the Admin Panel, "OAuth & Permissions" section in the sidebar, "Bot User OAuth Access Token".
Zini18:BlocksFun helge$ export SLACK_ACCESS_TOKEN=xoxb-YOUR-TOKEN
Zini18:BlocksFun helge$ swift run
2020-07-17T17:13:12+0200 notice μ.console : App started on port: 1337
cd BlocksFun
swift build
Or open the Package.swift
in Xcode and build it there.
SLACK_ACCESS_TOKEN
(the token required to send requests to Slack)SLACK_VERIFICATION_TOKEN
(shared secret with Slack to verify requests)PORT
(the port the app is going to start on, defaults to 1337)
On Linux this currently requires a Swift 5.3 environment (swiftc crash, might be SR-12543).
On macOS it should work with Swift 5.2 (aka Xcode 11) and up, though 5.3 has some additional conveniences.
SwiftBlocksUI is brought to you by the Always Right Institute and ZeeZide. We like feedback, GitHub stars, cool contract work, presumably any form of praise you can think of.