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
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
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
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
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
Open source, native iOS Messenger, with realtime chat conversations (full offline support).

OVERVIEW This is a native iOS Messenger app, with realtime chat conversations (full offline support). NEW FEATURES Passcode support GraphQL server sup

Related Code 4.5k Dec 26, 2022
Chat-App - GV Chat App is an iOS app built with Swift

GV Chat App - iOS Explore the docs Β» Report Bug Β· Request Feature About The Proj

Cyrus Dumbwani 0 Jan 25, 2022
Fully Functional iOS14 Swift Chat app Using Firebase as backend.

Social Chat Messenger App This iOS14 Chat App is built with Swift in Xcode12 and Using Firebase as backend to authenticate users. Features Light and D

null 0 Nov 25, 2021
iOS - Real-time messaging app 🎨

General mChat is a real-time messaging app written in Swift for iOS devices. Since mChat uses a fast and reliable Firebase Database, it receives data

Vitaliy Paliy 569 Nov 28, 2022
Save data to the database, real-time synchronization, user authentication.

Shop List App on development stage... description description description description description ??️ License This project is licensed under the MIT L

Sergey Lukaschuk 0 Nov 2, 2021
🌟🌟🌟🌟🌟 Falcon Messenger is a Fast and Beautiful cloud-based messaging app. With iOS and IPadOS Support. Available on the App Store.

Open the FalconMessenger.xcworkspace in Xcode. Change the Bundle Identifier to match your domain. Go to Firebase and create new project. Select "Add F

null 397 Dec 31, 2022
A private messenger for iOS.

Signal iOS Signal is a free, open source, messaging app for simple private communication with friends. Also available on Android and Desktop. Question

Signal 9.6k Dec 26, 2022
Jake Brown Tech Messenger With Swift

Open the FalconMessenger.xcworkspace in Xcode. Change the Bundle Identifier to m

Jake Brown 3 Feb 20, 2022
[Unofficial] IP Messenger for macOS

IP Messenger for macOS β€œIP Messenger for macOS” is a pop up style message communication software for multi platforms. It’s a port of Windows Version.

null 2 Dec 31, 2021
BubblesChatAppIos - A realtime messenger application Allows the users to communicate through virtual chats

Bubbles Chat App a realtime messenger application Allows the users to communicat

null 1 Jan 22, 2022
Secret Messenger - a free and open source Jabber (XMPP) messaging client for Apple

Secret Messenger is a free and open source Jabber (XMPP) messaging client for Apple and Android devices focused on Privacy and Security with full OMEMO encrypted messaging support.

Secret Messenger 4 May 2, 2022