Freddy Benson Freddy Benson - 2 months ago 96
Swift Question

Importing Firebase Framework manually in Xcode 8 (Swift 3)

I'm trying to import Firebase Storage into my Xcode project. I followed this guide.

I only imported the actual

.framework
file from the downloadable client library, along with all the other required frameworks and files, listed in the link above (the two
.dylib
files either do not exist anymore or have been renamed to something else, so the documentation is definitely outdated).

I'm guessing this isn't sufficient to get the Framework running in my Xcode project, as I did get an error that Firebase wasn't a recognized module. If it's all the other files (a few
.h
files,
.module
file and a
info.plist
file) I need to import as well, I was wondering how to do this in a Swift-written project?

Also, do I need all the files, or just some of them? The instructions in the documentation are very useless (probably because they're outdated), so I'm hoping someone with experience importing the framework into Xcode 8 (Swift 3) can give me some instructions. The documentation makes the importing process sound so easy, but I'm pretty sure it's a little more complex than that.

Answer

That guide is for our old client library (the deprecation warning at the top of the page confirms your suspicion that the docs are out of date :).

Instead, you'll want to use: https://firebase.google.com/docs/ios/setup#frameworks

You'll need FirebaseAnalytics.framework (to get FIRApp) as well as FirebaseDatabase.framework and Firebase.h. I believe we've got modulemaps properly working there, so you shouldn't have to mess with linker flags or other libs, as the modulemaps will include them properly.