Skip to content
This repository has been archived by the owner on Aug 25, 2018. It is now read-only.

googlearchive/ios-swift-chat-example

Repository files navigation

Status: Archived

This repository has been archived and is no longer maintained.

status: inactive

This is a legacy Firebase example (for SDK 2.x.x). You probably want to use one of the up-to-date examples at https://firebase.google.com/docs/samples


Swift Chat Example

Chat implemented in Swift! Now works in Xcode 6.0.1.

animated screenshot of this app in use

What's here

  • You can log in with Twitter.
  • You can post / receive messages
  • Powered by Firebase

If you have issues with XCTest, check out this issue.

Setup

This example still has some rough edges around authentication. Push through them, though. It's worth the effort.'

Configure Firebase

  1. Go to your Firebase Dashboard and create a new Firebase app.
  2. Clone this repo.
  3. Open FireChat-Swift.xcodeproj in Xcode.
  4. Edit MessagesViewController.swift and change swift-chat.firebaseio.com to point to your Firebase.

Configure Login

  1. Create a new Twitter app to use for login.
  2. Go to your Firebase Dashboard and navigate to your Firebase app.
  3. Click 'Login & Auth' in the left side menu. Select 'Twitter' and check the box to 'Enable Twitter Login'
  4. Paste your Twitter API Key and API Secret into the form.
  5. Edit LoginViewController.swift and change swift-chat.firebaseio.com to point to your Firebase. Update twitterAppId on the next line to match your Twitter API Key.
  6. Run the app on a device or simulator
  7. On your iOS device or simulator, go to Settings, scroll down to the accounts section (which contains Twitter, Facebook, Flickr and Vimeo), select Twitter -> Add Account.

no, that's not my password, but if you can figure out what I typed, tweet at me, and I'll send you Firebase swag

License

MIT