StreamChat

2.4.0

Official iOS SDK for Stream Chat
GetStream/stream-chat-swift

What's New

2.4.0

2020-10-01T10:24:47Z

🔄 Changed

  • Starscream dependency updated from 3.1 to latest (4.0.4) #511

Added

  • queryMembers API for queriyng members, see docs #521

Official iOS/macOS SDK for Stream Chat

StreamChatClient StreamChatCore StreamChat
Cocoapods Carthage compatibleSwift Package Manager compatibleClient Documentation Cocoapods Carthage compatibleSwift Package Manager compatibleCore Documentation Cocoapods Carthage compatibleSwift Package Manager compatibleUI Documentation

stream-chat-swift is the official iOS SDK for Stream Chat, a service for building chat and messaging applications. This SDK also supports macOS via Mac Catalyst.


Feeling adventurous?

👉 Check out the README of the new version of the StreamChat framework, currently in public beta.


Quick Links

Swift/iOS Chat Tutorial

The best place to start is the iOS Swift Chat Tutorial. It teaches you how to use this SDK and also shows how to make frequent changes.

Example App

This repo includes a fully functional example app with setup instructions. It is available under the Example folder.

Docs

You'll typically want to start out using the UI components, and implement your components using the Swift Chat API as needed.

Requirements

  • iOS 11+/macOS 10.15+
  • Xcode 11.2+
  • Swift 5.2
  • CocoaPods 1.7+
  • Carthage 0.33.0+

Mac Catalyst

Our frameworks are compatible with Mac Catalyst, meaning you can create a chat application that works on both iOS and macOS. Read about it here.

⚠️ Carthage does not support Mac Catalyst yet. (ref)

Installation

Stream Chat SDK consists of three frameworks: StreamChat, StreamChatCore and StreamChatClient

  • StreamChatClient - the low-level library that connects & communicates with StreamChat backend.
  • StreamChatCore — building on top of StreamChatClient, it includes models, presenters, and notification manager. Additionally, it has RxSwift support for reactive programming.
  • StreamChat — building on top of Core, it's the full SDK library with all UI components. Styling and deep customizations are all supported out of the box.

CocoaPods

To integrate StreamChat into your Xcode project using CocoaPods, add this entry in your Podfile:

pod 'StreamChat'

Then run pod install.

If you want to use only StreamChatCore or StreamChatClient', you can add this entry in your Podfile`:

pod 'StreamChatCore'
# or
pod 'StreamChatClient'

In any file you'd like to use Stream Chat in, don't forget to import the frameworks:

import StreamChat

or if you are working with the low-level client or Core:

import StreamChatCore
// or
import StreamChatClient

Carthage

To integrate Stream Chat into your Xcode project using Carthage, specify it in your Cartfile:

github "GetStream/stream-chat-swift"

Then run: carthage update --platform iOS --new-resolver. It will build the frameworks: StreamChatClient.framework, StreamChatCore.framework and StreamChat.framework into <Path to your Project>/Carthage/Build/iOS/ from where you can add them to your project and link them with your app target. Follow with these steps:

  • Open your Xcode project

  • Select the project in the Navigator

  • Select your app target

  • Open General panel

  • Open <Path to your Project>/Carthage/Build/iOS/ in Finder and find StreamChatClient.framework, drag and drop it into Frameworks, Libraries, and Embedded Content area in Xcode. Do the same for StreamChatCore.framework and StreamChat.framework if you need UI components.

  • After adding libraries, select "Do Not Embed" option in "Embed" section. (Right next to the library name after adding it)

  • Open Build Phases panel in Xcode

  • Click the + button and select New Run Script Phase

  • Set the content to: /usr/local/bin/carthage copy-frameworks

  • Add to Input Files:

    • $(SRCROOT)/Carthage/Build/iOS/StreamChatClient.framework

    • $(SRCROOT)/Carthage/Build/iOS/Starscream.framework

    • if you need Core library:

      • $(SRCROOT)/Carthage/Build/iOS/StreamChatCore.framework
      • $(SRCROOT)/Carthage/Build/iOS/RxSwift.framework
      • $(SRCROOT)/Carthage/Build/iOS/RxCocoa.framework
      • $(SRCROOT)/Carthage/Build/iOS/RxRelay.framework
    • if you need UI components:

      • $(SRCROOT)/Carthage/Build/iOS/StreamChat.framework
      • $(SRCROOT)/Carthage/Build/iOS/Nuke.framework
      • $(SRCROOT)/Carthage/Build/iOS/SnapKit.framework
      • $(SRCROOT)/Carthage/Build/iOS/SwiftyGif.framework
      • $(SRCROOT)/Carthage/Build/iOS/RxGesture.framework
  • Add to Output Files:

    • $(BUILT_PRODUCTS_DIR)/$(FRAMEWORKS_FOLDER_PATH)/StreamChatClient.framework

    • $(BUILT_PRODUCTS_DIR)/$(FRAMEWORKS_FOLDER_PATH)/Starscream.framework

    • if you need Core library:

      • $(BUILT_PRODUCTS_DIR)/$(FRAMEWORKS_FOLDER_PATH)/StreamChatCore.framework
      • $(BUILT_PRODUCTS_DIR)/$(FRAMEWORKS_FOLDER_PATH)/RxSwift.framework
      • $(BUILT_PRODUCTS_DIR)/$(FRAMEWORKS_FOLDER_PATH)/RxCocoa.framework
      • $(BUILT_PRODUCTS_DIR)/$(FRAMEWORKS_FOLDER_PATH)/RxRelay.framework
    • if you need UI components:

      • $(BUILT_PRODUCTS_DIR)/$(FRAMEWORKS_FOLDER_PATH)/StreamChat.framework ()
      • $(BUILT_PRODUCTS_DIR)/$(FRAMEWORKS_FOLDER_PATH)/Nuke.framework
      • $(BUILT_PRODUCTS_DIR)/$(FRAMEWORKS_FOLDER_PATH)/SnapKit.framework
      • $(BUILT_PRODUCTS_DIR)/$(FRAMEWORKS_FOLDER_PATH)/SwiftyGif.framework
      • $(BUILT_PRODUCTS_DIR)/$(FRAMEWORKS_FOLDER_PATH)/RxGesture.framework

Now you can build your app and use StreamChat.

Swift Package Manager

You can directly add dependency in Xcode 11+ using repo url, or in your Package.swift file, add to dependencies:

.package(url: "https://github.com/GetStream/stream-chat-swift.git", from: "2.3.0"),

Supported features

  • Group chat
  • Channel list
  • Reactions
  • Rich link preview (e.g. open graph)
  • Attachments (images, videos and files)
  • Commands (e.g. /giphy)
  • Editing messages
  • Typing events
  • Read events
  • Threads
  • Notifications
  • Opening a link in the internal browser
  • Image gallery
  • GIF support
  • Light/Dark theme
  • Style customization
  • UI customization

Description

  • Swift Tools 5.2.0

Dependencies

Last updated: Sat Oct 31 2020 07:58:19 GMT-0500 (GMT-05:00)