Everyone welcome back to class.
And Johnny B he was never stop stop.
And we're going to get this course going we are going to be learning all about firebase social logons
we're going to be covering Facebook Google and Twitter bhajans or I.
So let's get started and create a new X code project here.
Let me just open that up.
New project.
Drag out over here.
And this is going to be a single view.
And I say Next don't call this firebase.
So shall I put this on the desktop you're going to say next.
And desktop going created get repository and that looks gyud.
All right so the next thing we need to do is create our firebase project.
So we're just going to open up a browser here and go ahead and navigate to your firebase console.
So if you have a Google account then you are able to create firebase projects.
So just go to console dot firebase Google dot com and under your account you'll be able to create new
projects through and create a new project here and add project Hanigan going give it a project name
when we call this firebase social.
I want to say create and this takes just a couple of seconds to get everything set up for you.
So once that's finished I'll be right back.
All right.
Perfect.
So here we are in our dashboard and we're going to need to add firebase to our iOS app.
So let's go ahead and click on this and we're going to need our ladies when to jump back into X code
and right here grab our bundle identifier and copy that paste it here and we'll give it a nickname going
to call this firebase social.
I'm not going to do a store Id and say register app next thing we're going to need to do is download
our config file and this holds all the information so that our app knows what database to point to and
all that kind of stuff.
So when I download that and once that's downloaded I'm going to go ahead and grab it and just pull it
into our project you can just drop it right there and make sure that you have the ad to target checked
and say finish.
But if you were in the early stages of X code at 9.
Make sure that you click on this and look at your file inspector over here and make sure that this target
membership is checked.
There's been a lot of bugs with X cotinine.
And one of the big ones is that when you add a new file into your project the target membership is often
not checked.
So just just a heads up there.
So we got that done.
Let's jump back into firebase and see what's next going to see it continue.
And we're going to need to initialize our pods or so we're going to be using cocoa pods to add all of
the different STK that we're going to be using including firebase off off the Google Facebook and Twitter
SDK that are required.
So let's go ahead and jump into terminal here and I'm going to change our directory to our project I'm
going to say CD and then I put that on the desktop and we called it firebase social see.
And then we say pod in it and what this does is this initialises a pod file.
So now if we take a look at our project folder here let me just pull it up OK.
So now we see that we have a POD file here and I'm going to open mine with Adam.
That's one of my preferred text editors.
So here we go here under Pod's for firebase social.
We're going to say pod and let's see what did our guy tell us we needed firebase core went to copy that
and then just paste it right here.
And I'm actually going to go ahead and tell you all of the other pods that we were going to be using
here as well just to get it all out of the way.
Right.
So we have Podd and we have firebase slash off.
OK.
And so that's the pod the SDK for firebase.
We're going to be using to handle all the authorization or the authentication I should say.
And then we're going to have the pod and this is Google sign in and then pod and then we have our Facebook
ones.
So this is f b s d k core kit.
And then we have f b s d k share kit and POD FBA SDK log in kit.
And lastly we have for Twitter we have Podd Twitter kit.
Either I'm going to save that and I'm going to just go ahead and quit out of Adam.
And we're back here in our terminals so now that we have added the pauses to our pod file all we got
to do is say pod install.
All right very good.
No says Please close in the correct code sessions and use the X-C workspace.
So we're going to get into ex-school.
We're going to close this project and then we're going to now when our firebase social project we now
see that we have a white file with the extension X-C workspace so now we are going to from now on whenever
you're working with cocoa BOD's after you install the cookie pods you work in the X-C workspace file.
All right very good.
So now when we open up this we see that we have a new target with pods and POD file as well as our frameworks
and pods.
So that is good.
Next thing I want to do is we are going to open up our main story board and we are just going to add
our log out button here to see button and drag that in and we will pin it say 20 from the left and 20
from the right and 20 from the bottom we'll add those three constraints as well as I want to change
the height to 40 and I'm going to say add one constraint and double click on it and change the label
to log in.
Or I should say log out and then we're going to change its text color to white and the background color
to dark gray is good.
Now we're going to put one label right above it.
And this is just the label to kind of give a little bit of feedback as to whether or not we are logged
in.
So I'm going to go ahead and pin this 8 from the bottom 20 from the left and 20 from the right and then
we're to change it to center aligned and change the lines to to right there.
That I'm going to remove the text.
Perfect.
Now go ahead and add a couple of the outlets and actions for these I'm going to hold option and click
on a view controller to open up our assistant editor and here in the View Controller file I'm going
to delete this and this comment here and then here we're going to need some outlets will say I'll be
outlets and I'm going to control and drag from our label here in the hierarchy and control drag and
say user info label and that's and let it connect and then we're going to make an action for our log
out button.
So here we see action is log out tapped and that's an action and I want to close our assistant editor
from back into our.
If you control it us with file and that is all we are going to do.
In this lesson.
Just setting up the project.
I'm getting our firebase project created and getting a little bit of set up.
So in the next lesson we were going to jump right into Google log in and getting that all figured out.
Right.
So I'll see you in the next.