cozzin / sendbird-chat-sample-ios

This repository provides feature-level Chat samples with Swift.

Home Page:https://sendbird.com/docs/chat

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Sendbird Chat SDK Sample for iOS

Platform Language License: MIT Tuist - Build

This repository provides feature-level Chat samples with Swift.

πŸš€ Get started

You must use tuist to build these sample apps.

1. Install tuist

curl -Ls https://install.tuist.io | bash

2. Install Dependencies

tuist fetch

3. Generate Xcode project & workspace

tuist generate 

For more details: Tuist Docs

4. Execute sample apps

  1. Execute Samples.xcworkspace.
  2. Select the scheme of the feature you want to test.
  3. Run the scheme.

πŸ— Project structure

.
β”œβ”€β”€ 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.

πŸ›  For contributors

Below is an additional explanation for contributors.

πŸ“² How to add new Feature Sample App with tuist

  1. Copy Apps/BasicGroupChannel or Apps/BasicOpenChannel
  2. Paste under Apps folder.
  3. Rename folder name BasicGroupChannel to {FeatureSampleName}
  4. Rename parameter "BasicGroupChannel" to "{FeatureSampleName}" in Apps/{FeatureSampleName}/Project.swift
let project = Project.app(name: {FeatureSampleName})
  1. Re-generate Xcode project & workspace
tuist generate

Considerations in real world app

  • 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.

About

This repository provides feature-level Chat samples with Swift.

https://sendbird.com/docs/chat

License:MIT License


Languages

Language:Swift 100.0%Language:Objective-C 0.0%