The Knock Swift SDK is a client-side SDK for interacting with the Knock API and for building in-app notification experiences across iOS, macOS, and watchOS. In this guide, we'll show some of the main ways you can interact with the SDK.
To use this example, you'll need an account on Knock, as well as an in-app feed channel with a workflow that produces in-app feed messages. You'll also need:
- A public API key for the Knock environment (which you'll use in the
- The channel ID for the in-app feed (which you'll use in
You can install the Swift SDK in a few different ways:
- Swift Package Manager (SPM)
You can add the package by pointing to the Github repo:
github "knocklabs/knock-swift" ~> 0.1.0 to your Cartfile.
Follow the steps listed in the README here.
Add the dependency to your Podfile:
You must authenticate the SDK using your publishable key (prefixed by
pk_) and the user ID to make requests against.