|
| 1 | +# Swift Package Manager for Firebase **Beta** |
| 2 | + |
| 3 | +## Introduction |
| 4 | + |
| 5 | +Starting with the 6.31.0 release, Firebase supports installation via [Swift |
| 6 | +Package Manager](https://swift.org/package-manager/) in Beta status. |
| 7 | + |
| 8 | + |
| 9 | +## Limitations |
| 10 | + |
| 11 | +- Requires at least Xcode 12 beta 4. |
| 12 | +- SwiftUI Previews require Xcode 12 beta 5. |
| 13 | +- Analytics requires clients to add `-ObjC` linker option. |
| 14 | +- Analytics is only supported for iOS and cannot be used in apps that support other platforms. |
| 15 | +- Messaging, Performance, Firebase ML, and App Distribution are not initially available. |
| 16 | +- watchOS support is not initially available. |
| 17 | + |
| 18 | +## Installation |
| 19 | + |
| 20 | +If you've previously used CocoaPods, remove them from the project with `pod deintegrate`. |
| 21 | + |
| 22 | +Install Firebase via Swift Package Manager: |
| 23 | + |
| 24 | +<img src="docs/resources/SPMAddPackage.png"> |
| 25 | + |
| 26 | +Select the Firebase GitHub repository - `https://github.com/firebase/firebase-ios-sdk.git`: |
| 27 | + |
| 28 | +<img src="docs/resources/SPMChoose.png"> |
| 29 | + |
| 30 | +Select the beta branch. |
| 31 | + |
| 32 | +Note: Starting with the 6.31.0 release, the versions are specified |
| 33 | +in a format like 6.31-spm-beta. We won't support standard repository |
| 34 | +versioning until later in the beta or with general availability of the SPM |
| 35 | +distribution. |
| 36 | + |
| 37 | +<img src="docs/resources/SPMSelect.png"> |
| 38 | + |
| 39 | +Choose the Firebase product and any additional products that you want installed |
| 40 | +in your app. |
| 41 | + |
| 42 | +<img src="docs/resources/SPMProducts.png"> |
| 43 | + |
| 44 | +If you've installed FirebaseAnalytics, Add the `-ObjC` option to `Other Linker Flags` |
| 45 | +in the `Build Settings` tab. |
| 46 | + |
| 47 | +<img src="docs/resources/SPMObjC.png"> |
| 48 | + |
| 49 | +## Questions and Issues |
| 50 | + |
| 51 | +Please provide any feedback via a [GitHub |
| 52 | +Issue](https://github.com/firebase/firebase-ios-sdk/issues/new?template=bug_report.md). |
| 53 | + |
| 54 | +See current open Swift Package Manager issues |
| 55 | +[here](https://github.com/firebase/firebase-ios-sdk/labels/Swift%20Package%20Manager). |
0 commit comments