Integrate Google Firebase services into your Spezi application.
This Module allows you to use the Google Firebase platform as a managed backend for authentication and data storage in your apps built with the Spezi framework.
We currently implement support for Authentication, Storage, and Firestore services.
You need to add the Spezi Firebase Swift package to your app in Xcode or Swift package.
Important
If your application is not yet configured to use Spezi, follow the Spezi setup article# to set up the core Spezi infrastructure.
The below section walks you through the necessary steps to set up the Spezi Firebase Module for your application.
To connect your app to the Firebase cloud platform, you will need to first create an account at firebase.google.com then start the process to register a new iOS app.
Once your Spezi app is registered with Firebase, place the generated GoogleService-Info.plist
configuration file
into the root of your Xcode project.
You do not need to add the Firebase SDKs to your app or initialize Firebase in your app,
since the Spezi Firebase Module will handle these tasks for you.
You can also install and run the Firebase Local Emulator Suite for local development. To do this, please follow the installation instructions.
First, you will need to add the SpeziFirebase Swift package to your app in Xcode or Swift package.
In the example below, we configure our Spezi application to use Firebase Authentication with both email & password login and Sign in With Apple, and Cloud Firestore for data storage.
import Spezi
import SpeziAccount
import SpeziFirebaseAccount
import SpeziFirebaseStorage
import SpeziFirestore
import SwiftUI
class ExampleDelegate: SpeziAppDelegate {
override var configuration: Configuration {
Configuration {
AccountConfiguration(configuration: [
.requires(\.userId),
.collects(\.name)
])
Firestore()
FirebaseAccountConfiguration[
authenticationMethods: [.emailAndPassword, .signInWithApple]
]
}
}
}
For more information, please refer to the API documentation.
The Spezi Firebase Module comes pre-configured in the Spezi Template Application, which is a great way to get started on your Spezi Application.
Contributions to this project are welcome. Please make sure to read the contribution guidelines and the contributor covenant code of conduct first.
This project is licensed under the MIT License. See Licenses for more information.