So let's go ahead and create our app, you should be pretty used to doing this by now.
I've got into Xcode and hit new project that's hit next on app and let's paste in that ID that we recorded
in the previous section.
So this is the ID that we gave our FIREBASE app.
We have to make sure that these are the same.
We want to storyboard UI kit app delegates swift and leave all the rest unchecked.
Click next.
And we're going to drop this into the source code of my particular folder here.
I have some old source code there, but let's create a new one.
Shot, shot, fired three.
And it creates.
So that should go ahead and do what it needs to do, right, we're in now, what's the first thing we
have to do?
Well, let's expand this.
And if you recall in our Fireback section, we downloaded this config file up top here.
So let's go ahead and add that.
Let's right click this folder and let us go for where is it now?
And file that they add files to come up, G.K microdot, et cetera.
So what we're going to do is go to our downloads.
Go today, modifieds.
Google service info dash to dot, palest.
I'm just going to double click that important, but to make sure that things work, I'm going to press
enter on it and I'm going to remove the Dashty because that should be the actual name of it.
OK, now you'll notice this place has, of course, a bunch of properties.
We've got a client ID reversed, client ID, API, key, etc. a whole bunch of things.
OK, so we got also very interesting is ads enabled, currently set to zero.
So we might want to change those if we want to make advertising revenue from our apps.
And just so you know, a messaging app is actually a very good ad revenue generator because people are
looking at the screen all the time.
OK, let me give you an example of a bad revenue generator.
It would be something like a music app where you set a playlist going and then you switch the screen
off.
And so the user is not looking at ads during that time, which is why games earn a lot more.
It's not the only reason they earn a lot more, but they earn a lot more in ads because that's one of
the primary reasons you're staring at the screen the whole time.
So, I mean, I do know music apps that make a whole bunch of money on ads, so it's not a lost cause
by any means.
But apps like this where people are staring at the screen are likely to earn you a lot more.
OK, so that's the service info we're in, except we don't have any firebase installed in the app.
Now, if we go to the Ad Firebase SDK, it tells us we should use part files.
I don't really want to use cocoa pods.
What I want to use is the Swift package manager.
So let's have a look here.
Swift package manager for what is it, Firebase?
So if you go to the firebase.
Probably here, the second option on GitHub, it'll tell you how to use the package manager.
And what you need, so analytics, so if you're going to add analytics, you have to add a link or option.
I won't go into that, but just say, you know, you can look it up yourself if you need it.
Installation, if you've used cocoa pods before to install Firebase, then definitely remove it first
using the method they say there.
But in Xcode we want to get the SWIFT package manager in files with packages.
And then this is the important section to copy this.
So if packages out a dependency, drop this in and then go ahead and let it pass everything right,
so the first thing it's going to ask you for is the version now, because this is fairly new, there
are some version notes to look out for.
So prior to seven versions, selection is not available and.
OK, I know I did have an issue with this a little while back, so we're going to have up to next,
Major.
So it's going to take the current version, which is about sex, and it will keep upgrading it until
we get to seven or just before seven.
And it won't go any further.
That's in case you break your own application.
So, of course, you can change all of this much later on if you need to.
But you need to be aware that whenever there are major upgrades in software, there will be things that
break is just the way it is.
Usually they're fairly good at telling you what's broken and how to solve it and what to watch out for
before you even upgrade.
So it's worth looking at the notes before you just tap that upgrade button nilly and then give yourself
three days of hair pulling out headaches because you thought it would just work.
But that ain't how software works.
It never does just work.
So this is endlessly resolving.
I don't know what that's about.
I'll take a little pause here, right?
So that was a pain.
What I had to do was add the swift package and specify Fergin seven point zero point zero.
The other versions might have worked, but they just looked like they weren't resolving at all.
OK, so once it actually resolves, you should get presented with something like this.
You can start to include the packages you need.
So we want analytics.
We definitely want authentication.
Otherwise, how can I use this log in and post data?
We want the database crash politics.
You can leave out for now.
We don't need that.
We'll have firestorm in there.
Uh, Firestones with Peter.
Firebase functions now, you can actually add all of this later on, functions of those cloud functions
I told you about in a previous lecture, Firebase installation's firebase messaging, firebase storage
and storage, swift beta.
So, again, as I say, we can come back and change these later on.
But I'm just going to select those is a good general selection to start with.
Now that's going to go off and fetch everything it needs to do.
Whilst we do that, you'll notice that I no longer have my list file in here because the whole thing
was failing to compile.
So I just started again in case something got stuck.
That's a fairly good idea, a fairly good strategy if your items get stuck to do that.
OK, so we've got our list in there.
Let's again, change that name.
I also think I did something wrong with you guys there, the bundle ideas chitchat, and I think when
I was installing this here, I got it slightly wrong with you.
So let's check out our info.
Please note, we want the Xcode project info.
Where is it I'm losing it, stay, guys, I've forgotten where all the stuff is.
Let's right click it and see if we have properties and we don't know what.
I'll just solve that problem, cross that bridge when we come to it.
OK, so you got a bundle.
Everything's working.
I believe our packages should now be installed.
If you look right up at the very top of Xcode, we are indexing these files because as you'd imagine
from those packages, there are a lot of files to index.
All right.
That indexing is pretty much done now after a little break.
The next thing we have to do is initialize Firebase.
So we're going to import Firebase.
And the only line we need is down here, which is Firebase Dot Configure.
So let's copy that over to the clipboard and I'll show you where to put that.
It's an app delegate.
Let me just double check that.
Yes, it did finish launching with options.
So it is usually the very first thing that's listed here.
But make sure it is this particular one and set down here before we return.
True.
We're going to have Firebase App Configure and that's going to give an error because we haven't yet
imported Firebase.
OK, go ahead and save that file.
Everything should compile fine up to you if you want to test this out on a simulator.
But Firebase works exactly as you expect on a simulator as well as on a device.
So there are no issues between those classes of device as in virtual or real.
OK, so that's Firebase totally integrated.
We can actually get on with making our app now.