The course is part of this learning path
In this course, we're going to create an Instagram Clone and learn how to work with cloud servers using Firebase. By the end of this course, you will be well-equipped to build your own apps!
This course is designed for anyone who wants to:
- Learn about iOS development and coding
- Move into a career as an iOS developer
- Master Swift skills
To get the most out of this course, you should have some basic knowledge of iOS.
Hi. Within this lecture, we're going to discuss the final details of the Firebase. For example, in our Database, remember, we started with the test mode. And it actually allows us to read and write without any condition and it's not very safe to do that. So, let's try to view the documentation and let's try to make our Firebase safer than already is. So, this is the Firestore Security Rules documentation and you can find tons of information in here. You can see how to write conditions, how to allow the read, how to allow the write based on a different condition. If you're going to publish an app on the App Store, I really suggest you guys to come over here and take a look at the Security Rules so that you may find a real good example of what you're wanting to do in your app. But, for right now, let me show you a quick way how to make your application safer. So, we are allowing everything in here, read and write, without any condition, okay? To add a new condition in here, after you say, 'allow read, write'. You will hit a space, okay? You will bring a space in here like this and you will have to put a 'write: if request.auth != null'. It means that if the request has authenticated using our app, like signing in or signing up, then allow read and write. If you hit 'Publish', it will just save the Security Rules. And as you can see, you can see the versions over here so that if it breaks your code, or if it doesn't work, you can go back anytime you want. After you change the Security Rules, you should, of course, come over here and test to see if you can write something new to your app. So, let's try to upload another picture over here say, 'Mona', and say, 'Upload'. And as you can see, it got uploaded and it got downloaded so we can read and write in our app so that it's working. Let's try with another user. Let's sign in with James, okay? 'firstname.lastname@example.org'. So, let's sign in. And as you can see, we can see the posts with James as well. We can write in the database. So, when we hit 'Like', it brings up the like count. And in here, you can see the version of the Security Rules so that if anything happens, you can revert back anytime you want. So, let me 'Open' my Safari because I want to go to 'firebase.google.com' to show you another thing. I'm going to go for 'Pricing'. And as you know, this is completely free when you test your app. But after your app meets a certain volume, you may have to pay up to the Firebase because it has some kind of limitations. For example, you can have one gigabyte of data in the Firestore. You can have some 10,000 authentication in one month. Okay, authentication requests in one month. And if you want to upgrade, there is a Flame Plan, it's $25 per month at this current moment. And if you exceed this plan as well, there's a Blaze Plan, you pay as you go. So, if you have an app in mind and if you wonder, "How much should I pay if I reach like 100,000 people in my app?" You can come over here and try to calculate what would be the sufficient amount to invest in that app. So, if you come up with a startup idea or if you're looking for investors, you will know how much money you would have to invest with that kind of volume in your app, okay? And Firebase is cheap, I believe, for the service they provide because they are providing a very good service. They're providing us with a very powerful backend. They're providing us with very powerful database. We can do real time updates. We can do storage. We can do authentication. It's hard to find that kind of service in these days. We're going to see an alternative later on called Parse. But, I believe, Firebase is better right now. So, I hope you enjoyed this one. So, let's meet in the next section to continue learning about iOS developments.
Atil is an instructor at Bogazici University, where he graduated back in 2010. He is also co-founder of Academy Club, which provides training, and Pera Games, which operates in the mobile gaming industry.