# Firebase Tutorial: Getting Started

**URL:** <https://forums.kodeco.com/t/firebase-tutorial-getting-started/42152>\
**Category:** 🎓 Courses & Articles\
**Created:** [May 2, 2018, 1:01pm UTC](https://forums.kodeco.com/t/firebase-tutorial-getting-started/42152 "2018-05-02T13:01:56Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![kmikael](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/kmikael/32/76055_2.png) [@kmikael](https://forums.kodeco.com/u/kmikael)\
**Post date:** [May 2, 2018, 1:01pm UTC](https://forums.kodeco.com/t/firebase-tutorial-getting-started/42152/1 "2018-05-02T13:01:57Z")

</div>

In this Firebase tutorial, you'll learn Firebase fundamentals including saving data, real-time sync, authentication, user status, and offline support.

* * *
 This is a companion discussion topic for the original entry at [https://www.raywenderlich.com/3-firebase-tutorial-getting-started](https://www.raywenderlich.com/3-firebase-tutorial-getting-started)

---

<div class="post-metadata">

**Author:** ![alexz](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/alexz/32/81494_2.png) [@alexz](https://forums.kodeco.com/u/alexz)\
**Post date:** [May 2, 2018, 1:07pm UTC](https://forums.kodeco.com/t/firebase-tutorial-getting-started/42152/2 "2018-05-02T13:07:42Z")

</div>

Why didn’t you update the project to Cloud Firestore. Is more powerful and full of benefits.

---

<div class="post-metadata">

**Author:** ![xdeleon](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/xdeleon/32/81494_2.png) [@xdeleon](https://forums.kodeco.com/u/xdeleon)\
**Post date:** [May 2, 2018, 1:12pm UTC](https://forums.kodeco.com/t/firebase-tutorial-getting-started/42152/3 "2018-05-02T13:12:01Z")

</div>

Thx for the tutorial. I think you meant Swift 4.1 and not Swift 41!

---

<div class="post-metadata">

**Author:** ![raj123](https://s3.amazonaws.com/cdn.raywenderlich.com/community/forum-assets/noun-game-ghost-878668.png) [@raj123](https://forums.kodeco.com/u/raj123)\
**Post date:** [May 2, 2018, 9:11pm UTC](https://forums.kodeco.com/t/firebase-tutorial-getting-started/42152/4 "2018-05-02T21:11:44Z")

</div>

It would be good if you could add how to count the items in the grocery list and display the count on the app

---

<div class="post-metadata">

**Author:** ![kmikael](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/kmikael/32/76055_2.png) [@kmikael](https://forums.kodeco.com/u/kmikael)\
**Post date:** [May 6, 2018, 1:03am UTC](https://forums.kodeco.com/t/firebase-tutorial-getting-started/42152/5 "2018-05-06T01:03:36Z")

</div>

Thanks for letting us now, @xdeleon, I fixed the typo.

---

<div class="post-metadata">

**Author:** ![kmikael](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/kmikael/32/76055_2.png) [@kmikael](https://forums.kodeco.com/u/kmikael)\
**Post date:** [May 6, 2018, 1:05am UTC](https://forums.kodeco.com/t/firebase-tutorial-getting-started/42152/6 "2018-05-06T01:05:10Z")

</div>

@alexz It looks like Cloud Firestore is currently still in beta. We might do a new tutorial about this in the future.

---

<div class="post-metadata">

**Author:** ![dcdude](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/dcdude/32/105896_2.png) [@dcdude](https://forums.kodeco.com/u/dcdude)\
**Post date:** [May 7, 2018, 2:12am UTC](https://forums.kodeco.com/t/firebase-tutorial-getting-started/42152/7 "2018-05-07T02:12:37Z")

</div>

Awesome tutorial! Where in the documentation would you suggest I look to grant another user access a record and its children?

---

<div class="post-metadata">

**Author:** ![magnas](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/magnas/32/105896_2.png) [@magnas](https://forums.kodeco.com/u/magnas)\
**Post date:** [May 11, 2018, 3:01pm UTC](https://forums.kodeco.com/t/firebase-tutorial-getting-started/42152/9 "2018-05-11T15:01:21Z")

</div>

I’m a little confused by the user authentication implemented in the tutorial and the security rules for the realtime database.

If the app was in the AppStore wouldn’t all users be using the same grocery list? Any user seems able to gain access to the list by registering an email/password. How could I restrict login to say family and friends?

Or am I missing the point completely? Is this implementation of the database ‘public’ by design and not suited to simply letting a single user or a small defined group access their own data?

---

<div class="post-metadata">

**Author:** ![nayem](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/nayem/32/103278_2.png) [@nayem](https://forums.kodeco.com/u/nayem)\
**Post date:** [May 19, 2018, 8:30am UTC](https://forums.kodeco.com/t/firebase-tutorial-getting-started/42152/10 "2018-05-19T08:30:57Z")

</div>

Actually, in your **Registering Users** section something should be changed. The `Auth.auth().createUser(withEmail:password:)` automatically signs in a user upon successful account creation. So practically you don’t need to call `Auth.auth().signIn(withEmail:password:)` there. And I believe this is due to change in firebase authentication design change but not at the time of writing this tutorial for the first time. More on [Create a password-based account](https://firebase.google.com/docs/auth/web/password-auth)

---

<div class="post-metadata">

**Author:** ![shogunkaramazov](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/shogunkaramazov/32/108826_2.png) [@shogunkaramazov](https://forums.kodeco.com/u/shogunkaramazov)\
**Post date:** [May 29, 2018, 7:38pm UTC](https://forums.kodeco.com/t/firebase-tutorial-getting-started/42152/11 "2018-05-29T19:38:29Z")

</div>

@kmikael Could you please help with this when you get a chance? Thank you - much appreciated! :]

---

<div class="post-metadata">

**Author:** ![kmikael](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/kmikael/32/76055_2.png) [@kmikael](https://forums.kodeco.com/u/kmikael)\
**Post date:** [June 3, 2018, 7:03am UTC](https://forums.kodeco.com/t/firebase-tutorial-getting-started/42152/12 "2018-06-03T07:03:51Z")

</div>

Normally, you would implement Auth differently. We only made everything public for simplicity in this tutorial. You can restrict access such that a user can only see their collection for example.

You can see this guide: [Use conditions in Realtime Database Security Rules &nbsp;|&nbsp; Firebase Realtime Database](https://firebase.google.com/docs/database/security/user-security)

---

<div class="post-metadata">

**Author:** ![kmikael](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/kmikael/32/76055_2.png) [@kmikael](https://forums.kodeco.com/u/kmikael)\
**Post date:** [June 3, 2018, 7:05am UTC](https://forums.kodeco.com/t/firebase-tutorial-getting-started/42152/13 "2018-06-03T07:05:15Z")

</div>

If I’m understanding correctly, you want to edit security rules. You can try here: [Use conditions in Realtime Database Security Rules &nbsp;|&nbsp; Firebase Realtime Database](https://firebase.google.com/docs/database/security/user-security)

---

<div class="post-metadata">

**Author:** ![aremvee](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/aremvee/32/81494_2.png) [@aremvee](https://forums.kodeco.com/u/aremvee)\
**Post date:** [June 19, 2018, 1:52am UTC](https://forums.kodeco.com/t/firebase-tutorial-getting-started/42152/14 "2018-06-19T01:52:13Z")

</div>

Mikael, maybe the reader would understand that you have to exit XCode before doing a ‘pod install’ but you should really say so expressly, and that one loads the .xcworkspace file thereafter.

---

<div class="post-metadata">

**Author:** ![kmikael](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/kmikael/32/76055_2.png) [@kmikael](https://forums.kodeco.com/u/kmikael)\
**Post date:** [June 20, 2018, 2:37am UTC](https://forums.kodeco.com/t/firebase-tutorial-getting-started/42152/15 "2018-06-20T02:37:46Z")

</div>

Thanks for the concerns. This is an intermediate tutorial and we decided to assume the reader knows how to use CocoaPods. There are many online tutorials about this including the official site.

---

<div class="post-metadata">

**Author:** ![iondalion](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/iondalion/32/76339_2.png) [@iondalion](https://forums.kodeco.com/u/iondalion)\
**Post date:** [July 6, 2018, 11:10am UTC](https://forums.kodeco.com/t/firebase-tutorial-getting-started/42152/16 "2018-07-06T11:10:41Z")

</div>

Hey @kmikael thanks a lot for a great tutorial!  
May I ask you how we would Update and existing cell with Firebase? I am kinda struggling on figuring that out.  
Any info is greatly appreciated,  
Thanks!

---

<div class="post-metadata">

**Author:** ![shogunkaramazov](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/shogunkaramazov/32/108826_2.png) [@shogunkaramazov](https://forums.kodeco.com/u/shogunkaramazov)\
**Post date:** [July 6, 2018, 11:31am UTC](https://forums.kodeco.com/t/firebase-tutorial-getting-started/42152/17 "2018-07-06T11:31:57Z")

</div>

@kmikael Can you please help with this when you get a chance? Thank you - much appreciated! :]

---

<div class="post-metadata">

**Author:** ![spgms](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/spgms/32/111854_2.png) [@spgms](https://forums.kodeco.com/u/spgms)\
**Post date:** [July 9, 2018, 3:19pm UTC](https://forums.kodeco.com/t/firebase-tutorial-getting-started/42152/18 "2018-07-09T15:19:39Z")

</div>

Is there a version of this which uses CloudKit/iCloud?

---

<div class="post-metadata">

**Author:** ![fnoyanisi](https://s3.amazonaws.com/cdn.raywenderlich.com/community/forum-assets/noun-game-ghost-878668.png) [@fnoyanisi](https://forums.kodeco.com/u/fnoyanisi)\
**Post date:** [July 15, 2018, 11:59am UTC](https://forums.kodeco.com/t/firebase-tutorial-getting-started/42152/19 "2018-07-15T11:59:00Z")

</div>

Hi there. Thanks for the awesome tutorial! I am struggling to understand how in LoginViewController.swift you manage to call performSegue() within viewDidLoad, before the view is totally loaded and visible? Is this something to do with Firebase?Thank you

---

<div class="post-metadata">

**Author:** ![shogunkaramazov](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/shogunkaramazov/32/108826_2.png) [@shogunkaramazov](https://forums.kodeco.com/u/shogunkaramazov)\
**Post date:** [July 31, 2018, 4:09pm UTC](https://forums.kodeco.com/t/firebase-tutorial-getting-started/42152/20 "2018-07-31T16:09:58Z")

</div>

@kmikael Do you have any feedback regarding this? Thank you - much appreciated! :]

---

<div class="post-metadata">

**Author:** ![dv24](https://s3.amazonaws.com/cdn.raywenderlich.com/community/forum-assets/noun-game-ghost-878668.png) [@dv24](https://forums.kodeco.com/u/dv24)\
**Post date:** [August 1, 2018, 11:26pm UTC](https://forums.kodeco.com/t/firebase-tutorial-getting-started/42152/21 "2018-08-01T23:26:35Z")

</div>

**SOLVED** : For Registering Users, users are _ **only** _ added to Firebase when the password is **minimum of 6 characters!**. If you put in _less_ than 6 characters, users will not be added to the Firebase user panel.

Hi @kmikael,

I believe the section, **Registering Users** , should be updated. I followed your instructions and do not see any new users being registered in my Firebase Authentication panel. I am able to add items to the list and see the effects immediately so that’s fine, but the same doesnt happen for when I try to sign up new users. Another user above, nayem, made similar mention of this as well.

And yes, I have Email/Password **enabled** in the _Authentication \> Sign-in Method_ panel.

Code in LoginViewController.

```
@IBAction func signUpDidTouch(_ sender: AnyObject) {
    let alert = UIAlertController(title: "Register",
                               message: "Register",
                               preferredStyle: .alert)
    
    let saveAction = UIAlertAction(title: "Save", style: .default) { _ in
        // 1
        let emailField = alert.textFields![0]
        let passwordField = alert.textFields![1]
        
        // 2
        Auth.auth().createUser(withEmail: emailField.text!, password: passwordField.text!) { user, error in
            if error == nil {
                // 3
                Auth.auth().signIn(withEmail: self.textFieldLoginEmail.text!,
                                 password: self.textFieldLoginPassword.text!)
            }
        }
    }
.....

```

[Next page](https://forums.kodeco.com/t/firebase-tutorial-getting-started/42152.md?page=2)
