Placeholder Image

Subtitles section Play video

  • Uh huh.

  • That's what I was hoping for.

  • What's up, guys?

  • First night here and Logan, Authentication didn't really us plan.

  • I thought I was gonna be able to pump out this video to you guys within a week of starting my app.

  • Which means, of course, I was going to incorporate Facebook, Twitter, Google and then regular email logging authentication to my application within that one week.

  • But that didn't really pan out because, well, to be honest with you guys, my very first extra project I scraped the whole entire thing after I created my you I after I imported fire base.

  • You know, I created that I did.

  • I connected firebase in my AB, and I imported a Facebook sdk imported Google sdk or to incorporate those.

  • I just scrapped it because I don't know why the constraints are fine, but the you I wasn't working right as you guys saw the beginning of this video, and it was like the Google sdk wasn't being imported.

  • Although my pod file said it was.

  • And even when I did pot install it showed that it was imported.

  • It's like the line of code that said import Google.

  • Sinan wasn't there because I was getting all these airs for the code that I wrote that had to do with that needed that Google the import Google sign in line in orderto work.

  • I needed the sdk, but it just it just didn't was just giving the errors.

  • And I don't know if that was because I tried to do Facebook authentication first and didn't complete it.

  • I don't know what the whole case was and the reason behind me not completing the Facebook long enough indications, because I don't Facebook account, So I need to create one in order to access Facebook for developers.

  • When I did that, faces for developers wanted me to verify myself trying to hear my verify myself, and then they never got back to me so I would have had to create a whole new Facebook.

  • So I just decided to go ahead and go with Google authentication.

  • So before scrapping that extra project, I copied my user interface because I didn't want to create that whole entire thing again.

  • Although it was kind of messing up with the constraints.

  • I imported that into a new Exco project, and it worked just fine.

  • I had toe add like one or two constraints because those didn't follow it, but it still worked Fine.

  • I don't know what was wrong with the with the one before And mind you, I'm on X code eight the final The final update.

  • Extra date.

  • As of this time, I'm not on exclude nine beta.

  • I would understand if it was a beta version to get errors, but that that that wasn't the problem with me.

  • I don't know what the case was, but I create a new project and it went away.

  • So when it after that is, of course, I imported my firebase.

  • I had to connect those two and then I forgot Facebook because Facebook developers never really got back to me.

  • Although I know I could have created new email account or new email account in the new Facebook account with that email.

  • I just didn't do it.

  • So I imported the Google sdk on.

  • I followed the documentation that firebase provides you for incorporating Google sign in to your IOS application using fire base, of course, and I followed started following that along with some other videos.

  • And what not because although it seems laid out.

  • Step one.

  • Step two.

  • Step three.

  • In the firebase documentation, it wasn't as easy as they made it out to be.

  • And there's a few things like in the documentation.

  • It said, Have this line say firebase app dot config But it was really f i r ap duck and fig.

  • And they're just a few things like that where the code didn't actually translate exactly over to the X code code.

  • So what I did was I looked at a few videos and that kind of help me out, but nor do better explain this.

  • Let me, uh, let me throw myself down in this little bubble right here or here, and then I'm going to show you guys my code.

  • So let me get the computer.

  • And so you guys okay?

  • First, we're gonna look at the main dot storyboard, So as you can see, it's a little bit different than the simulator.

  • Let's look at the simulator.

  • We have white text here for your name.

  • Email password.

  • We also have the Google signing button and your name email password.

  • Right here.

  • As you can see, isn't white in order to do that.

  • What I did when I came over to What inspector is this?

  • This is the identity inspector.

  • Let me actually select this.

  • And I added, in this key path, type and value so user, to find runtime attributes, I made it when it's during run time, which is the simulator.

  • I made it white.

  • And of course, since that's the actual placeholder text, I'm gonna change that to a more clear or grayish tepid text.

  • And then once someone starts typing in that text field, it's going to be white.

  • But, you know, I just incorporated that so I could see it.

  • I wanted to be a line.

  • And this isn't my final.

  • You eye for the log in screen, but it's what I have for now and then.

  • As for the Google signing button, we'll have to come over to our few controller, which I know this up Here, let me click.

  • Awful.

  • This is called a view controller, Classified controller view controller dot swift and then classify controller here.

  • I'm gonna change those names to something like log in screen are just log in that swift and class is gonna be called log in or sign up or whatever screen that was because view controller doesn't describe it well and I'm gonna have quite a few different view controllers.

  • So I need to make sure each one his name properly.

  • But in order to incorporate the Google button, I throw in this code right here.

  • And as you can see, it's it's marked by comment because comments are your friend.

  • Add Google logging button.

  • So I throw this in and I set my own X y with in height value in order to get it at this location and that this within this height.

  • Although I don't think this is 50 tall, I don't know if I don't know why that's the case, what it is, and in order to for this code to work this line of code right here in port to Google, Sinan imports sdk that I already saved into my pod file And this line 11 what was what wasn't working or wasn't reading this line in my first extra project, and that was like a big problem.

  • I don't know what the case was there, but it didn't work, so I just scrapped it.

  • And here we are now and within my glass view controller, which will be named Log in soon I added in G i D which stands for a Google I d sign in you I delegate in order to make everything work So it kind of works is a hierarchy.

  • I need to import Google.

  • Sign in for Jaidi signing you.

  • I delegate toe work and I need toe incorporate G i d signing you I delegate in order to allow this code toe work.

  • So he's had to make sure you have each step.

  • If I were to add this code in first without having this or this that's your on air, for example, Let me save it.

  • And as you can see, I have all of these errors and that's because this was deleted.

  • But let's put it back in.

  • These errors may still be there for a second until it loads up.

  • I saved it, So it should.

  • Yep, there goes.

  • And what I did was I incorporated that this snippet of code right here into a file private function called set up Google Buttons and then ran set up Google buttons and view did load function.

  • So I did that because otherwise imagine if I had 20 of these different types of deals.

  • So if I had 20 buttons, because after you can create your whole entire user interface in your view controller, so have all these different buttons or that need Thio be in their own function.

  • It would kind of be not very clean if all of that was inside of you did load by itself.

  • So I threw that into its own, filed a private function the night through that file Private Function name, interviewed it load in order to make it work.

  • So that's why it's set up like that.

  • So all this code runs when the view loads.

  • And speaking of view, loading, that's when this comes in and let me show you right here.

  • What happens when I click this Google Sinan button?

  • So as you can see when the button is clicked, it takes us over to basically the Google Web site it makes us enter.

  • Our email makes a sense our password, and then we're able to you know, that way we're longing to our application, and right now it's gonna take us back to the same exact screen because, well, we don't have any other screens.

  • But in other words, you know, if if it was your first time walking into a real application, it would take you into the actual application because you're logged in at that point.

  • But right now, we don't have that happened because I'm already logged in.

  • And what does happen is let me pull this up.

  • Let me make this a little bit bigger.

  • Is this I collected quite a few times, Aiken.

  • Yeah, I know, but I have code that reads us successfully logged in.

  • Wait.

  • Yeah.

  • Here we go.

  • Successfully logged into Google, and then we make sure we're successfully logged in tow, firebase with google.

  • So it logs into Google first.

  • And then it talks to the firebase that back in to make sure that you know everything is working properly and that we store that log in into firebase.

  • Otherwise, you have to.

  • You wouldn't really have a profile.

  • That's a point of using fire bases the back in.

  • Let's close that back up.

  • Let me show you what I'm talking about down here where we had.

  • So, as you can see, if we failed to log in, typed in wrong information, this is what we would get.

  • But since we didn't type in wrong information.

  • This is what we got successfully logged into goo.

  • And then same thing goes for when it checks back, you logging in checks back to store into fire base.

  • If something's wrong, it's going to say failed to create a firebase user with Google account.

  • And that's going to say the error.

  • It's going to say that essentially the Google account and then successfully logged into fire base with Google is what appears.

  • You know, it has a user.

  • I d is what appears win.

  • Well, you sense we log in and all this code is only possible because we incorporated Jaidi signing delegate, not you.

  • I delegate because this isn't a view controller and this is only working because we incorporated imported Google.

  • Sign it.

  • So that plays back to in our pod file and importing our sdk.

  • So pot install imports the Google sdk, and that's what allows us to import the Google Sinan application.

  • And then we're able to throw in all of our proper code or to incorporate this little button right here.

  • All of this is for this little button and to create yourself as a user and this is a little line of code was talking about earlier for app that configure, it used to say on the documentation.

  • It said Firebase, let me show you firebase app and that doesn't work.

  • As you can see, it's not green.

  • It will give us an heir and a little bit if I don't change it.

  • But let me change back.

  • There we go.

  • And that was that was a problem.

  • Not necessary.

  • The problem.

  • But that's the problem with the firebase documentation is that it's not up to date, I guess.

  • I don't know what the cases, but just remember that if you're gonna incorporate Google son in or any of those to make sure, it's f I R abductor figure.

  • And when I say that it's the firebase Google Sinan documentation, Of course, when you incorporate son and to begin with, it also says Firebase doc and figure.

  • But you want to make sure it's i r ap duck and figure.

  • And then it also says Firebase, fight for AP Down here, you have to make sure that's consistent with what works up here, all right, and going into detail, a little bit of detail when it comes to this code down here.

  • So if you could see guard, let we have I d.

  • Token, we have access token, we have credentials.

  • You can read more about this on that documentation I've been talking about.

  • But basically what this is doing is just checking through everything we're checking through to make sure that Google, you know, the sun and works for Google.

  • And then down here is what we're doing is making sure everything works for Google into fire base.

  • Like I've mentioned plenty of times because that's the process you have.

  • The button takes you to Google.

  • You log into Google.

  • Look, we will make sure it's good, and after you log in Google or Fire Base, make sure that that Google profile is good and not created before.

  • And so it's not already in the database.

  • And if it's good to go, then it'll be successfully logged in and it will create a new user.

  • If that's your initial, log it.

  • So that's kind of how this works.

  • That's how it would work your face with this.

  • How Twitter that's That's even how it would work with a regular email log in to make sure you're not already a user, and it creates you new user I d.

  • If that's the case and that's for logging authentication, that's it.

  • For now on, I do have a few videos in the works that aren't exactly documenting my eye was development journey.

  • But it is things that I've either talked about on this channel before.

  • I have a tiny house kind of video update coming on because I have a lot of people asking me kind of mentioned tiny house winning a tiny house before and a lot of people ask me about it.

  • So I'm gonna make a video addressing that and then my next I was development Journey won't be incorporating the next thing, which I think maybe a profile.

  • I don't know yet, though, So I want to get developing on that this week, and I'll let you guys know, of course, whether it's on Ah, I'll let you guys know Instagram.

  • So follow me on Instagram.

  • You'll see the little screen thing or link is down in this Christian but low, and you'll be able to kind of keep up to date with what I'm doing on a daily basis and see what this next video is gonna be about.

  • But until then, I'm gonna threw out a few of these other videos, like the tiny House one and then a few otherwise have to do without development in the iPhone.

  • But that's it for now.

  • So I hope you enjoyed the video.

  • If you have any questions, even done below right below that, you know, like button.

  • And be sure to share this with any friends that you think you're interested in our development and well, until next time, have a going.

Uh huh.

Subtitles and vocabulary

Click the word to look it up Click the word to find further inforamtion about it