Git Product home page Git Product logo

messenger-ios-chat-swift-firestore's Introduction

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.

If you get a build error in latest Xcode, 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 React Native Templates.

messenger-ios-chat-swift-firestore's People

Contributors

buikhanhduy avatar mrcflorian avatar vsouza avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

messenger-ios-chat-swift-firestore's Issues

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

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!

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

Chat messages not visible

I am not sure how it's supposed to work. But when I download the project, run it and send some message, I don't really see the messages. It's completely blank. Do I need to do anything else other than the steps mentioned?

Ultimate Firebase Chat

Hi, I’d like to contribute to the effort of creating a great Firebase Chat library for iOS written in Swift. There are currently 780 repos on GitHub and I am in a process of writing the 781st one. Which kind of doesn’t make sense.

Would you be interested in joining forces and working together on a common library?

https://github.com/kutakmir/OpenFirebaseChat/

I made an incentive to create a community-driven Firebase Chat library that we all can use and will be better than any of the individual ones that are out there at the moment. We can start by forking one of the existing ones and then keep on improving it together.

Unable to find GroupChat

Hello

I am unable to find the group chat code in the codebase.

Please let me know if I am missing something.

Thanks

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.

Connecting Instamobile to a different dataset

Hey,

When I download and run the readily available version of instamobile, it works perfectly, but when I integrate instamobile to a different project, it only loads up this screen:
Screen Shot 2019-04-11 at 22 41 15

I can type in the text box but can't send a message, and it also doesn't load up the chat lobby- is this an issue of connecting instamobile to some data? if so how can I do that? I already have my firestore googleplist on the project

many thanks

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!

Swift 4.2 Compilation Errors

Is anyone else getting a lot of errors when trying to compile?

/messenger-iOS-chat-swift-firestore/Pods/MessageKit/Sources/Views/InsetLabel.swift:34:30: 'inset(by:)' has been renamed to 'UIEdgeInsetsInsetRect(::)'

I am getting these errors like this and others, and I have changed my XCode build to the legacy one.

I am using the latest XCode 11.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.