This folder contains the source code for Stream Chat's official sample app. You can use it to get a preview of the features and for other testing purposes. It contains multiple samples for different design patterns and use cases in one project using both StreamChat and StreamChatUI.
- Close this repository.
- Open
StreamChat.xcodeproj
on Xcode. - Wait for Swift Package Manager to install dependencies.
- Select the
Sample
target and run in your preferred device.
You can use the login to configure the authentication, other user details, and select which sample to enter. It comes pre-configured with a test API Key and a pre-existing user, which you can change by editing the text fields. On the top right, you can press ↻ to get a different pre-existing user. You can also choose between authenticating with a JWT, as a guest, or with a development token. The latter must be allowed in the Stream Chat dashboard. To generate a JWT, you need your app's secret and one of the server-side SDKs or this JWT generator.
After setting your user details, you can choose any of the listed samples. Each of them is built with a different design pattern or use case in mind.
On the bottom of the login screen, you can find additional options to initialize the chat client. You can choose whether to use the local storage, flush it on start, and select which region your app is in.
These samples are built on top of StreamChat. It provides local database logic and API calls, but no UI components. Use StreamChat if you want to build a completely custom UI from scratch. We kept the UI simple to focus on the StreamChat usage.
This sample uses the traditional delegate pattern to listen to chat events and update the UI, which is built with UIKit.
This sample uses Apple's new Combine framework to process the chat events and update the UI, which is also built with UIKit.
This sample is built with declarative code by making full use of Apple's SwiftUI framework alongside StreamChat's ObservableObject wrappers.
These samples are built on top of StreamChatUI. It provides UIKit components that run on top of StreamChat. Use StreamChatUI if you want a ready-made fully-featured UI with some customizability options.