Messenger Clone - Real-time iOS Chat with Firebase Firestore written in Swift

Overview

Real time Swift iOS Chat with Firebase - Messenger Clone

This is an extremely simple chat app source code of an iOS Swift Chat app. It leverages MessageKit and it stores and retrieves data to/from Firebase Firestore. The app design is inspired by Facebook Messenger. Clone the iOS Chat App Source Code and add a fully fledged chat to your app in minutes.

Learn how to build your own iOS chat feature with only a few lines of code. Clone this iOS chat app source code and get started by following the steps below. For more details, check out our detailed technical documentation on the official iOS Swift Chat app page.

This project has now been updated to Swift 5. Make sure you run Xcode's Legacy Build System (File -> Workspace Settings).


How to run a demo app

  1. Download the source code by cloning this repository
  2. Download the GoogleService-Info.plist file from your Firebase Console and replace the existing file in ChatApp folder. This will connect the app to your own Firebase instance.
  3. Install the pods by running
pod update
  1. Open the xcworkspace file with the latest version of Xcode

How to integrate the chat into your app

  1. Download the source code and import the "Core" folder into your Xcode project
  2. Make sure you add all the Podfile dependencies into your own Podfile
  3. Replace the GoogleService-Info.plist file with your own file, downloaded from Firebase Console.
  4. Install the pods
pod update
  1. Use the following code to instantiate a chat view controller
let uiConfig = ATCChatUIConfiguration(primaryColor: UIColor(hexString: "#0084ff"),
                                      secondaryColor: UIColor(hexString: "#f0f0f0"),
                                      inputTextViewBgColor: UIColor(hexString: "#f4f4f6"),
                                      inputTextViewTextColor: .black,
                                      inputPlaceholderTextColor: UIColor(hexString: "#979797"))
let channel = ATCChatChannel(id: "channel_id", name: "Chat Title")
let viewer = ATCUser(firstName: "Florian", lastName: "Marcu")
let chatVC = ATCChatThreadViewController(user: viewer, channel: channel, uiConfig: uiConfig)

// Present the chatVC view controller
  1. Customize the UI by updating the ChatUIConfiguration class
    let mainThemeBackgroundColor: UIColor = .white
    let mainThemeForegroundColor: UIColor = UIColor(hexString: "#3068CC")
    let mainTextColor: UIColor = UIColor(hexString: "#000000")
    let mainSubtextColor: UIColor = UIColor(hexString: "#7e7e7e")
    let statusBarStyle: UIStatusBarStyle = .default
    let hairlineColor: UIColor = UIColor(hexString: "#d6d6d6")

    let regularSmallFont = UIFont.systemFont(ofSize: 14)
    let regularMediumFont = UIFont.systemFont(ofSize: 17)
    let regularLargeFont = UIFont.systemFont(ofSize: 23)
    let mediumBoldFont = UIFont.boldSystemFont(ofSize: 17)
    let boldLargeFont = UIFont.boldSystemFont(ofSize: 23)
    let boldSmallFont = UIFont.boldSystemFont(ofSize: 14)
    let boldSuperSmallFont = UIFont.boldSystemFont(ofSize: 11)
    let boldSuperLargeFont = UIFont.boldSystemFont(ofSize: 29)

    let italicMediumFont = UIFont.italicSystemFont(ofSize: 17)

Coded with love and supported by iOS App Templates.

This project was created using Cupertino Kit.

Comments
  • I am unable to get the receiver message

    I am unable to get the receiver message

    I have downloaded code and update the pod. Integrated GoogleInfo.plist in the source code. When I run the code, I am able to send the message and message is storing on firebase database, while unable to get message of receiver if receiver reply for my message. Please suggest what am I missing. I am using two different simulator with different sender and receiverID.

    opened by rajan-dev 4
  • Updated for latest Xcode/Swift syntax

    Updated for latest Xcode/Swift syntax

    • Updated project to resolve semantics issues with Xcode 10 and latest version of Swift
    • Removed Google .plist, users will have to provide their own
    • There is one outstanding issue of having to remove the camera button. The .system reference in the base master is no longer possible, would be good to know what the right approach for that is and have it re-implemented.
    opened by DanBurkhardt 2
  • Firestore convenience, camera button added back, pods removed, .gitignore implemented, other stuff

    Firestore convenience, camera button added back, pods removed, .gitignore implemented, other stuff

    added a convenience class that will help new devs get this working with a new instance of Firestore (ATCRemoteData.swift), added .gitignore to prevent accidental commits with GoogleService-Info.plist, gitignore won't track or add pods or Podfile.lock, debugging statements added throughout-- not having them means a clean terminal, but it is damn hard to stack trace if we don't know what is working and how. Also, modified ID scheming, it is more logical to make the chat threads look like {userID}:{userID} instead of concatenating the two

    opened by DanBurkhardt 1
  • I want to display text messages in different ways (e.g.. all CAPS), but what variable is the text stored??

    I want to display text messages in different ways (e.g.. all CAPS), but what variable is the text stored??

    I want to allow the user to display incoming messages in different ways (for example, a user might want to show all incoming chat messages in all CAPS). But I'm confused... in what variable is the text stored?

    I'm looking in the ATCChatMessage.swift file, and I see three variables which seem to store the message's text: (1) content: String, (2) messageText: String, and (3) kind: MessageKind (which I realize is a MessageKit Type). I don't really see a difference between "content" and "messageText". I guess, to simplify my question, where in the swift code is the chat message text displayed, and from what variable is it fetching from? That way I know which variable I can edit if I want the user to make different adjustments on the text based on predefined settings.

    Any help from someone would be greatly appreciated!

    opened by eric-solberg 0
  • Can not send Photos

    Can not send Photos

    When using the ChapAppTemplateSwiftMarch 15 demo app, I can not get photos to show in the Chat room.

    When using the camera, I get the console message as follows: [Camera] Failed to read exposureBiasesByMode dictionary.

    When using the photo library, I do get: [LayoutConstraints] Unable to simultaneously satisfy constraints. Probably at least one of the constraints in the following list is one you don't want. Try this: (1) look at each constraint and try to figure out which you don't expect; (2) find the code that added the unwanted constraint or constraints and fix it. ( "<NSLayoutConstraint:0x2800bbde0 UIView:0x1055e17e0.width == - 16 (active)>" )

    Will attempt to recover by breaking constraint <NSLayoutConstraint:0x2800bbde0 UIView:0x1055e17e0.width == - 16 (active)>

    Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger. The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKitCore/UIView.h> may also be helpful. 2020-11-08 13:38:52.843059-0800 ChatApp[2194:311708] [View] First responder warning: '<ChatApp.InputTextView: 0x109023800; baseClass = UITextView; frame = (0 0; 297 30); text = ''; clipsToBounds = YES; tintColor = UIExtendedSRGBColorSpace 0.188235 0.407843 0.8 1; gestureRecognizers = <NSArray: 0x282c791a0>; layer = <CALayer: 0x28226f940>; contentOffset: {0, 0}; contentSize: {150, 31.333333333333332}; adjustedContentInset: {0, 0, 0, 0}>' rejected resignFirstResponder when being removed from hierarchy

    Any help is appreciated. Thanks!

    opened by hsmith825 0
  • 237 Warning and 1 Error when using with swift5 and Xcode 11. Any fixes?

    237 Warning and 1 Error when using with swift5 and Xcode 11. Any fixes?

    Can't convert the file to swift 5 because it doesn't build. I'm getting around 237Warnings and 1 Error. (see attached files)

    Does anyone got a newer version already?

    Bildschirmfoto 2020-04-24 um 21 31 13

    Keep the work up! really cool project, and I am really very very sad that I can't actually add it to my social media app :(

    For fo a fix, Kind regards & Stay Safe Constantin

    opened by graphiGuy 3
  • 'MessageInputBarDelegate' has been explicitly marked unavailable here

    'MessageInputBarDelegate' has been explicitly marked unavailable here

    When I build on Xcode I receive:

    'MessageInputBarDelegate' has been renamed to 'InputBarAccessoryViewDelegate'
    

    Upon some research in MessageKit I've found:

    https://github.com/MessageKit/MessageKit/blob/5e16637ffc1fb39f2c3f9bc3396bbee41118947d/Sources/Supporting/MessageInputBar.swift#L31

    https://github.com/MessageKit/MessageKit/blob/413fd8f6ebad43efdde5f98be5fafb2e7986d83b/CHANGELOG.md#dependency-changes

    So I suppose MessageKit should be pegged to a version in the Podfile, but I'm unsure what version it was intended for...

    opened by lonnylot 0
MessengerKit is a drop-in UI for messenger interfaces on iOS built in Swift

About MessengerKit is a drop-in UI for messenger interfaces on iOS built in Swift. Centred around a single UIViewController, MessengerKit is themeable

Stephen Radford 1.5k Jan 2, 2023
Chatto is a Swift lightweight framework to build chat applications.

Chatto is a Swift lightweight framework to build chat applications. It's been designed to be extensible and performant. Along with Chatto there is ChattoAdditions, a companion framework which includes cells for messages and an extensible input component. You can find more details about how it was implemented in our blog. See them in action!

Badoo Tech 4.4k Dec 29, 2022
Flash Chat is an Internet-based messaging application similar to WhatsApp

Flash Chat is an Internet-based messaging application similar to WhatsApp. A service called Firebase Firestore is used as the backend database to store and retrieve our messages from the cloud.

Matias Adrián Molina 1 May 20, 2022
Messenger Clone - Real-time iOS Chat with Firebase Firestore written in Swift

Real time Swift iOS Chat with Firebase - Messenger Clone This is an extremely simple chat app source code of an iOS Swift Chat app. It leverages Messa

Instamobile 615 Dec 27, 2022
Messenger Clone - Real-time iOS Chat with Firebase Firestore written in Swift

Real time Swift iOS Chat with Firebase - Messenger Clone This is an extremely simple chat app source code of an iOS Swift Chat app. It leverages Messa

Instamobile 621 Jan 6, 2023
A full stack real time messenger clone. Frontend is written in swift, and the backend is written in javascript.

FullStack-Messenger-Project A full stack real time messenger clone. Frontend is written in swift, and the backend is written in javascript. The Fronte

Arkash Vijayakumar 6 Nov 29, 2022
Real time chat app written in Swift 5 using Firebase

Quick Chat for iOS Quick Chat for iOS is a real time chat app written in Swift 5 using Firebase. Quick Chat allows to send and receive text messages,

Henry Aslanyan 1.8k Dec 10, 2022
Flash-Chat - Firebase Cloud Firestore, TableViews and Cocoapod Dependencies

Flash-Chat Firebase Cloud Firestore, TableViews and Cocoapod Dependencies What I

null 0 Jan 19, 2022
Real time chat application in Swift 5 using Firebase

Real time chat application in Swift 5 using Firebase

null 1 May 13, 2022
Create a real time chat application in Swift 5 using Firebase

Messenger Real Time Chat App Project to create a real time chat application in Swift 5 using Firebase. Features Facebook Log In Google Sign In Email/P

null 2 May 29, 2022
Aplikasi iOS Advanced Level To Do List dengan Firebase Auth, SwiftUI, MVVM Design Pattern, dan Firebase Firestore

Aplikasi Tasker adalah aplikasi iOS To Do List yang dibuat menggunakan Autentikasi Firebase / Firestore dan MVVM Design Pattern.

DK 10 Oct 17, 2022
Anonymous chat app leveraging Google's Firebase, a NoSQL backend and WebSocket for real time data synching

Chaty Chaty is an anonymous chat app that allows millions of users to chat at the same time. Firebase is Google's real time NoSQL Backend as a Service

Terry Wang 369 Nov 26, 2022
Alejandro Piguave 24 Dec 30, 2022
Swift-Chat-Application - Swift Chat Application Using Firebase , messagekit

Swift-Chat-Application Using Firebase , messagekit

Metin ATALAY 7 Oct 9, 2022
A chat simulator app that uses FireBase for Authentication and chat storage

Chat-App Description Flash chat is a chat simulator app that uses FireBase for Authentication and chat storage Tools Used - Swift (Programming Languag

Victor Alvarenga 0 Oct 14, 2021
MVVM-of-SuYeon - Build an Instagram iOS App Clone with Cloud Firestore, Swift 5

MVVM-of-SuYeon Instagram Firestore App Clone | Swift 5 + iOS 14 | MVVM Build an

null 2 Feb 16, 2022
Firebase Cloud Firestore support library for iOS. 🧢

?? Ballcap-iOS Ballcap is a database schema design framework for Cloud Firestore. Why Ballcap Cloud Firestore is a great schema-less and flexible data

1amageek 229 Jan 2, 2023
Aplikasi iOS Simulasi CRUD Stok Barang dengan SwiftUI, Firebase CLI & Firestore

iStockery Aplikasi iStockery adalah aplikasi stok inventory berbasis iOS yang dibuat menggunakan Firebase (Firestore) secara Local dengan fitur CRUD d

DK 7 Aug 1, 2022
Integrate third party libraries by using Cocoapods and Swift Package Manager, store data in the cloud using Firebase Firestore.

Integrate third party libraries by using Cocoapods and Swift Package Manager, store data in the cloud using Firebase Firestore. Exercising query and s

WEI 0 Dec 19, 2021
Swift UIKit E-Commerce (UgurShopping) No StoryBoard Firebase, FireStore, FirebaseAuth, KingFisher, SwiftEntryKit, ProgressHud, Alamofire UICollectionViewCompositionalLayout, NotificationCenter

Swift UIKit E-Commerce (UgurShopping) No StoryBoard Firebase, FireStore, FirebaseAuth, KingFisher, SwiftEntryKit, ProgressHud, Alamofire UICollectionViewCompositionalLayout, NotificationCenter

Ugur Hamzaoglu 2 Oct 16, 2022