Sendbird Chat SDK Sample for iOS
This repository provides feature-level Chat samples with Swift.
When a new Sendbird application is created in the dashboard the default security settings are set permissive to simplify running samples and implementing your first code.
Before launching make sure to review the security tab under ⚙️ Settings -> Security, and set Access token permission to Read Only or Disabled so that unauthenticated users can not login as someone else. And review the Access Control lists. Most apps will want to disable "Allow retrieving user list" as that could expose usage numbers and other information.
You must use tuist to build these sample apps.
curl -Ls https://install.tuist.io | bash
tuist fetch
tuist generate
For more details: Tuist Docs
- Execute
Samples.xcworkspace
. - Select the scheme of the feature you want to test.
- Run the scheme.
.
├── Samples.xcworkspace
├── Modules
│ └── CommonModule # Common Logic & View
├── Apps
│ ├── BasicGroupChannel
│ ├── BasicOpenChannel
│ ├── GroupChannelFeatureA
│ ├── OpenChannelFeatureA
│ ├── ...
│ ├── GroupChannelFeatureN
│ └── OpenChannelFeatureN
└── Tuist
- UseCase: Objects that can be conceptually bundled and used in SendbirdSDK.
- For example, when implementing the chat room message list, the functions to initialize the list, get the previous message, and get the next message are mostly used together.
- So, even if it is not divided into screen units, things that can be grouped with a similar concept are grouped with UseCase.
- If necessary, change the Access Control of BaseModule to open and use it.
- View
- Small Views that can be easily modularized
- It is recommended to collect all Views that are used for both Group Channel and Open Channel here.
CommonModule
is used as an embedded framework in each Sample App.
Below is an additional explanation for contributors.
- Copy Apps/BasicGroupChannel or Apps/BasicOpenChannel
- Paste under Apps folder.
- Rename folder name
BasicGroupChannel
to{FeatureSampleName}
- Rename parameter
"BasicGroupChannel"
to"{FeatureSampleName}"
inApps/{FeatureSampleName}/Project.swift
let project = Project.app(name: {FeatureSampleName})
- Re-generate Xcode project & workspace
tuist generate
- In this sample repo users are connecting to sendbird using a user ID (Sendbird Dashboard --> Security --> Read & Write). Read & Write is not secure and will create a new user automatically from the SDK if none exists. In production be sure to change the Sendbird Dashboard security settings to Deny login, and authenticate users with a Sendbird generated Session Token.