Christian.

Firebase Auth

December 28, 2020

I’m blogging about my process & experience with setting up account creation, login, and authentication using Google’s Firebase.

Firebase

I, again, asked Reddit about potentially setting this up by myself, from scratch. I wanted to test out provisioning my own database and trying to write an account portal myself just to go through the exercise of it all. However, most everyone suggested against that so here we are.

I’m working off of this blog post and after signing up and installing Cocoapods I was ready to add my code.

Cocoa

Since there’s no AppDelegate in the new SwiftUI apps I had to add the Firebase.configure() in a different way but thankfully I found this blog post to help me out. It had me add it like this in the SwiftUI App Protocol.

    init() {
        FirebaseApp.configure()
    }

but then got the error

ld: in /Users/christianturner/Dev/Swift/TestApp/Pods/FirebaseAnalytics/Frameworks/FIRAnalyticsConnector.framework/FIRAnalyticsConnector(FIRAnalyticsConnector_a8eeba373b74508311b8b22b8d3202a6.o), building for iOS Simulator, but linking in object file built for iOS, file '/Users/christianturner/Dev/Swift/TestApp/Pods/FirebaseAnalytics/Frameworks/FIRAnalyticsConnector.framework/FIRAnalyticsConnector' for architecture arm64

but both this comment and this other blog resolved it! I know this is a lot of extra info about how I resolved these little issues, but maybe it’ll help out another fellow M1 user who runs into a similar issue.


Written by Christian Turner
Follow me on Twitter