WrapFast comes out of the box with Firebase integration to implement User Authentication, Cloud Storage with Firestore, Crash reports and Tracking Analytics.
In order to have this implementation up and running, you need to have a Google account and a Firebase project created.
After that, you will have to replace the file GoogleService-Info.plist file in the Xcode project.
Follow the next instructions to configure it.
First of all, you need to create a Firebase Project. If you don’t have already an account, create it here
The free tier is quite generous, therefore you don’t have to worry about usage quotas for MVPs. Check Firebase documentation to know more about limits.
When you already have an account, let’s create a Firebase project clicking Add project:
Type a name of your project:
Enable Google Analytics and Continue.
If you don’t have a Google Analytics Account, create one and Create Project:
When you have the Firebase Project created, click on iOS to add an app:
Insert your app bundle id, app name and app id. For this step you need to have created your app in the App Store Connect. Visit In-App Purchases section if you need more info.
Click in Register App:
<aside> ⚠️ Mind that the bundle ID is camelCase sensitive 👀
</aside>
Download the file GoogleService-Info.plist
and replace it for the one in the boilerplate.
Hit Next in Firebase until you finish the app creation. Don’t mind the next steps of implementation, it is already done in the boilerplate.
WrapFast comes with Sign in with Apple and Sign in with Google integrations to authenticate users. It is the more convenient and user-friendly way to authenticate users. In order to have this up and running you need to configure a couple thins in both Firebase and App Store Connect:
In Firebase Console, go to Authentication:
Click on Get Started and then click on Apple in the Additional providers list.
Turn on the Switch Enable, and copy the callback URL that appears down below.
Leave this tab opened and go to developer.apple.com > Certificates, Identifiers & Profiles > Identifiers > Plus button > App IDs and find your app identifier.
Scroll down and check that Sign in with Apple is checked. If you created the app from Xcode, it should be already checked on as the Capability is already added in the boilerplate.
If you create the App ID manually, you will need to check this on.
Create a Service ID for Sign in with Apple in developer.apple.com > Certificates, Identifiers & Profiles > Identifiers > Plus button > Services IDs
Type the required info and click Register. I use to set the same bundle id as the app and adding .service
at the trailing:
Click in the recently created Service ID and check Enabled for Sign in with Apple. After that, click in Configure:
In the dropdown menu on top, select your App ID.
In Domain and Subdomaind, type any domain, for example [test.com](<http://test.com>)
is valid to have it working.
In Return URLs, paste the callback URL you just have copied in the Firebase tab:
Click Next and Done to finish the Service configuration.
Back to the Firebase tab, type your recently created Service ID and click Save:
🥳 Congratulations! You have now Sign in with Apple configured to be used in your app.
<aside> 💡 Pro Tip: You can try it with your own Apple account, but I encourage you to create a test Apple account and add it to the Test Users list in the Sandbox. To do so, in App Store Connect, go to Users and Access and add your test Apple Account there. You can also enable Apple Pay to it to test In-App Purchases:
</aside>
This is way easier than Apple’s one, since you don’t need to configure anything on the App Store Connect.
You just need to add a new provider in your Firebase Authentication Console:
And select Google:
Then turn on Enable toggle. Type the public name that user’s will see when they are prompted to Sign in with their Google account. Select as well a contact email.
Hit save and download the new and updated GoogleService-Info.plist
file. Copy and paste it to Xcode and replace the previous one. Your new plist should look something like this:
Last but not least, you need to copy the REVERSED_CLIENT_ID
and go to Xcode, select your target, go to the Info tab, Click on the URL types dropdown menu, and paste the value like in the image down bellow:
And that’s it! You have now available Sign in with Google as well 🥳
You can find implemented in the Xcode project and example login button, in the Login View, along the Apple’s one.
Adding more login providers in Firebase is easy. However for iOS apps, every user has iCloud so they would prefer using Sign in with Apple since it is the most trusted method for Apple users and they can select to hide their email with just a single tap.
Thus, it is good enough providing only the Apple option and not overwhelming the user with different options. The sign up process is a friction for the user onboarding, so making it as simple as possible would increment conversions.
<aside> 💡
For more information, you can check Firebase official docs regarding this topic here.
</aside>
When an user authenticates successfully with Firebase, it will appear in the User’s list, within the Authentication section in Firebase:
Once you have your user authenticated, you may want to save User’s profile information and other app related data in a database. To do so, WrapFast relies on Firestore Database: a Cloud-hosted, real-time, NoSQL database for app development and synchronization.
Configuring it is pretty straightforward: