Skip to content

Support Multiple FirebaseApp - #8

Open
justbcuz wants to merge 7 commits into
SwiftfulThinking:mainfrom
justbcuz:multiple-firebaseApp-support
Open

Support Multiple FirebaseApp#8
justbcuz wants to merge 7 commits into
SwiftfulThinking:mainfrom
justbcuz:multiple-firebaseApp-support

Conversation

@justbcuz

@justbcuz justbcuz commented May 5, 2024

Copy link
Copy Markdown
Contributor

Added support to configure and initialize AuthProvider with a specific FirebaseApp instance.

Comment on lines +20 to +22
init(firebaseAuth: Auth) {
self.auth = firebaseAuth
}

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't done this in a project myself. How do you get an instance of Auth other than calling Auth.auth() ? Do you have a sample implementation on how you'd initialize this?

@justbcuz justbcuz May 16, 2024

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can start off with configuring a FirebaseApp with custom options.
FirebaseApp.configure(name: appName, options: options)

Then you can access the FirebaseApp by name
let firebaseApp = FirebaseApp.app(name: appName)

Then you can instanciate an Auth instance with FirebaseApp
let firebaseAuth = Auth.auth(app: firebaseApp)

Same thing can be done with Firestore and Storage
let firebaseFirestore = Firestore.firestore(app: firebaseApp)
firebaseStorage = Storage.storage(app: firebaseApp)

# Conflicts:
#	Sources/SwiftfulFirebaseAuth/Providers/FirebaseAuthProvider.swift
# Conflicts:
#	Sources/SwiftfulFirebaseAuth/Core/AuthManager.swift
#	Sources/SwiftfulFirebaseAuth/Providers/FirebaseAuthProvider.swift
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants