Hi again everyone and merry Christmas! Continuing from yesterday’s lesson, I reviewed Firebase’s documentation for how to connect it to an iOS app. Since I’m taking this as I go, I decided to make a note-keeping app that holds user data and allows them to update and delete them. Based on my previous knowledge of Firebase, it should work. If not, I’ll keep track of any notes and changes I have to make to ensure it functions well.
The steps to complete this are explained well, but here’s a quick run-through of what the article mentions:
- Requirements for using Firebase with iOS
- How to make a new Firebase project
- Connecting Firebase to the app
- Adding a Firebase configuration file
- Adding Firebase SDKs
- Adding initial Firebase code to app
- Firebase libraries
- Alternate ways to connect Firebase to iOS
I had a late start to this project and was only able to complete the Firebase project – I’ll be looking into making the necessary files for the iOS app tomorrow to connect and add on to this post.
The next steps weren’t as bad as I originally thought. For those who are new to Xcode and Swift, your project will have what’s known as an app nickname. After the app is created, it will have what’s called a bundle identifier. This is a combo of the file name you give the app as well as the organization name. You’ll need this in the first part to connect the app to Firebase.
The second part that I needed to clarify was adding the Firebase configuration file to all targets. I found out through this Stack Overflow question that this meant each element within the project. This means the initial file, Tests, and UITests.
The third part of interest was adding the Firebase SDK to Xcode. I’ve done this process in the past so I didn’t have a hard time with this. I wanted to update Firebase’s documentation for those with a newer version of Xcode. In order to add them in to any version of Xcode that’s at least 12, you’ll need to open File -> Add Packages.
Initializing Firebase was also easy, but another issue arises when following the docs. Using their initialization code on the Firebase prompt will result in an error message about how “UIApplicationLaunchOptionsKey” has been renamed to “UIApplication.LaunchOptionsKey” (emphasis added). Adding the period should remove the issue.
And that’s it! The next step will be to make the initial setup for the Android version of the app, which I’ll summarize in the next post.