Can FirebaseFirestoreSwift be installed by the Swift Package Manager?

Viewed 267

It looks to me like FirebaseFirestoreSwift cannot be installed using the Swift Package Manager because FirebaseFirestoreSwift is still in beta.

I understand that FirebaseFirestoreSwift could be installed using Cocoapods but I don't want to use cocoapods because I believe (perhaps incorrectly) that source control using github with cocoapods can be challenging.

I want FirebaseFirestoreSwift because I believe that is the only way to get the SwiftUI codable protocol working with Firebase.

1 Answers

Yes, FirebaseFirestoreSwift can be installed using SPM.

In your main dependencies, you'll want the main Firebase iOS SDK:

dependencies: [
        .package(name: "Firebase",
                 url: "https://github.com/firebase/firebase-ios-sdk.git",
                 from: .init("8.11.0"))
    ]

Then, the "FirebaseFirestoreSwift" can be used with the name "FirebaseFirestoreSwift-Beta" from the "Firebase" package:

//inside one of your target's dependencies:
.product(name: "FirebaseFirestoreSwift-Beta", package: "Firebase")
Related