Repository navigation
feat: enable Firebase 13 compatibility, remove unused dependency, and address build warnings #1406
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
1aeef0f
6a3de79
d005ba4
40b3384
0e23201
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -226,7 +226,7 @@ public final class AuthService { | |
| } | ||
|
|
||
| public func signOut() async throws { | ||
| try await auth.signOut() | ||
| try auth.signOut() | ||
| // Cannot wait for auth listener to change, feedback needs to be immediate | ||
| currentUser = nil | ||
| // Clear email link sign-in flag | ||
|
|
@@ -239,7 +239,7 @@ public final class AuthService { | |
| updateAuthenticationState() | ||
| } | ||
|
|
||
| public func linkAccounts(credentials credentials: AuthCredential) async throws { | ||
| public func linkAccounts(credentials: AuthCredential) async throws { | ||
| authenticationState = .authenticating | ||
| do { | ||
| guard let user = currentUser else { | ||
|
|
@@ -414,7 +414,7 @@ public extension AuthService { | |
| } | ||
| } | ||
|
|
||
| func createUser(email email: String, password: String) async throws -> SignInOutcome { | ||
| func createUser(email: String, password: String) async throws -> SignInOutcome { | ||
| authenticationState = .authenticating | ||
| let credential = EmailAuthProvider.credential(withEmail: email, password: password) | ||
|
|
||
|
|
@@ -474,7 +474,7 @@ public extension AuthService { | |
| } | ||
| } | ||
|
|
||
| func handleSignInLink(url url: URL) async throws { | ||
| func handleSignInLink(url: URL) async throws { | ||
| do { | ||
| // Check which flow we're in based on the flag | ||
| let email: String | ||
|
|
@@ -532,9 +532,9 @@ public extension AuthService { | |
| paramName: "ui_auid" | ||
| ) | ||
| if shouldHandleAnonymousUpgrade, anonymousUserID == currentUser?.uid { | ||
| try await handleAutoUpgradeAnonymousUser(credentials: credential) | ||
| _ = try await handleAutoUpgradeAnonymousUser(credentials: credential) | ||
| } else { | ||
| let result = try await auth.signIn(withEmail: email, link: link) | ||
| _ = try await auth.signIn(withEmail: email, link: link) | ||
| } | ||
| updateAuthenticationState() | ||
| // Track that user signed in with email link | ||
|
|
@@ -586,7 +586,7 @@ public extension AuthService { | |
| func signInWithPhoneNumber(verificationID: String, verificationCode: String) async throws { | ||
| let credential = PhoneAuthProvider.provider() | ||
| .credential(withVerificationID: verificationID, verificationCode: verificationCode) | ||
| try await signIn(credentials: credential) | ||
| _ = try await signIn(credentials: credential) | ||
| } | ||
| } | ||
|
|
||
|
|
@@ -758,7 +758,7 @@ public extension AuthService { | |
| } | ||
|
|
||
| do { | ||
| let result = try await resolver.resolveSignIn(with: assertion) | ||
| _ = try await resolver.resolveSignIn(with: assertion) | ||
| updateAuthenticationState() | ||
|
|
||
| // Clear MFA resolution state | ||
|
|
@@ -792,8 +792,6 @@ public extension AuthService { | |
| throw AuthServiceError.noCurrentUser | ||
| } | ||
|
|
||
| let multiFactorUser = user.multiFactor | ||
|
|
||
| // Create the appropriate assertion based on factor type | ||
| let assertion: MultiFactorAssertion | ||
|
|
||
|
|
@@ -814,7 +812,7 @@ public extension AuthService { | |
|
|
||
| case .totp: | ||
| // For TOTP, we need the secret from the session | ||
| guard let totpInfo = session.totpInfo else { | ||
| guard session.totpInfo != nil else { | ||
| throw AuthServiceError | ||
| .multiFactorAuth("TOTP info is missing from enrollment session") | ||
| } | ||
|
|
@@ -905,8 +903,8 @@ public extension AuthService { | |
|
|
||
| // MARK: - Private Helper Methods | ||
|
|
||
| private extension AuthService { | ||
| internal func updateAuthenticationState() { | ||
| extension AuthService { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. From the agent Note (Verified Safe, Optional Cleanup): Checked all remaining properties and methods inside this extension AuthService block (lines 918–1190) — every one explicitly declares private, so removing private from extension does not accidentally expose any private helper as internal. However, moving func updateAuthenticationState() out above private extension AuthService would keep private extension AuthService intact so any future helper added under // MARK: - Private Helper Methods stays private by default. |
||
| func updateAuthenticationState() { | ||
| authenticationState = | ||
| (currentUser == nil || currentUser?.isAnonymous == true) | ||
| ? .unauthenticated | ||
|
|
@@ -1090,7 +1088,8 @@ private extension AuthService { | |
|
|
||
| private func buildLegacySignInRecovery(email: String, | ||
| signInMethods: [String], | ||
| attemptedProviderId: String?) -> LegacySignInRecoveryContext? { | ||
| attemptedProviderId: String?) | ||
| -> LegacySignInRecoveryContext? { | ||
| let attemptedOptionId = attemptedProviderId.map(normalizeLegacyOptionId) | ||
| var options: [LegacySignInOption] = [] | ||
| var unavailableProviders: [String] = [] | ||
|
|
@@ -1137,7 +1136,9 @@ private extension AuthService { | |
| displayName: string.legacyEmailLinkOptionLabel | ||
| ) | ||
| default: | ||
| guard let provider = providers.first(where: { $0.id == normalizeLegacyOptionId(signInMethod) }) else { | ||
| guard let provider = providers.first(where: { | ||
| $0.id == normalizeLegacyOptionId(signInMethod) | ||
| }) else { | ||
| return nil | ||
| } | ||
| return LegacySignInOption(id: provider.id, displayName: provider.displayName) | ||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -20,7 +20,12 @@ import PackageDescription | |
| let package = Package( | ||
| name: "FirebaseUI", | ||
| defaultLocalization: "en", | ||
| platforms: [.iOS(.v17)], | ||
| platforms: [ | ||
| .iOS(.v17), | ||
| // Satisfies SPM's dependency graph check for FirebaseAuth 13 & GoogleSignIn 11. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should be GSI 10 |
||
| // This package only supports iOS. | ||
| .macOS(.v12), | ||
| ], | ||
|
Comment on lines
+23
to
+28
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Adding platforms: [.iOS(.v17)],
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. • SPM's Fallback Behavior: When a platform is omitted from platforms: [...] in Package.swift, SPM does not interpret it as "this platform is unsupported". Instead, it falls back to the default minimum
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This library didn't work on macOS before this PR, so there's no difference in outcome. |
||
| products: [ | ||
| .library( | ||
| name: "FirebaseDatabaseUI", | ||
|
|
@@ -74,15 +79,11 @@ let package = Package( | |
| ), | ||
| .package( | ||
| url: "https://github.com/firebase/firebase-ios-sdk.git", | ||
| "8.0.0" ..< "13.0.0" | ||
| "8.0.0" ..< "14.0.0" | ||
| ), | ||
| .package( | ||
| url: "https://github.com/google/GoogleSignIn-iOS", | ||
| from: "10.0.0" | ||
| ), | ||
| .package( | ||
| url: "https://github.com/google/GoogleUtilities.git", | ||
| "7.4.1" ..< "9.0.0" | ||
| "7.0.0" ..< "11.0.0" | ||
| ), | ||
| .package( | ||
| url: "https://github.com/SDWebImage/SDWebImage.git", | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No action required, but maybe we could annotate these with allow-unused-result upstream.