From 04388b0a60f09564f8d3748088dba4d3b80db721 Mon Sep 17 00:00:00 2001 From: Nick Cooke Date: Tue, 5 Nov 2024 12:04:30 -0500 Subject: [PATCH 1/2] [Docs] Fix DocC warnings in FirebaseAuth --- FirebaseAuth/Sources/Swift/Auth/Auth.swift | 6 ++---- .../Swift/AuthProvider/FederatedAuthProvider.swift | 3 +++ .../Sources/Swift/AuthProvider/OAuthProvider.swift | 5 +++-- FirebaseAuth/Sources/Swift/MultiFactor/MultiFactor.swift | 4 +++- .../Sources/Swift/MultiFactor/MultiFactorResolver.swift | 8 ++++---- FirebaseAuth/Sources/Swift/User/User.swift | 6 ++---- 6 files changed, 17 insertions(+), 15 deletions(-) diff --git a/FirebaseAuth/Sources/Swift/Auth/Auth.swift b/FirebaseAuth/Sources/Swift/Auth/Auth.swift index 8effd15c101..19e8029974b 100644 --- a/FirebaseAuth/Sources/Swift/Auth/Auth.swift +++ b/FirebaseAuth/Sources/Swift/Auth/Auth.swift @@ -252,8 +252,6 @@ extension Auth: AuthInterop { /// Sets the `currentUser` on the receiver to the provided user object. /// - Parameter user: The user object to be set as the current user of the calling Auth instance. - /// - Parameter completion: Optionally; a block invoked after the user of the calling Auth - /// instance has been updated or an error was encountered. @available(iOS 13, tvOS 13, macOS 10.15, macCatalyst 13, watchOS 7, *) open func updateCurrentUser(_ user: User) async throws { return try await withCheckedThrowingContinuation { continuation in @@ -1430,6 +1428,7 @@ extension Auth: AuthInterop { } /// Revoke the users token with authorization code. + /// - Parameter authorizationCode: The authorization code used to perform the revocation. /// - Parameter completion: (Optional) the block invoked when the request to revoke the token is /// complete, or fails. Invoked asynchronously on the main thread in the future. @objc open func revokeToken(withAuthorizationCode authorizationCode: String, @@ -1450,8 +1449,7 @@ extension Auth: AuthInterop { } /// Revoke the users token with authorization code. - /// - Parameter completion: (Optional) the block invoked when the request to revoke the token is - /// complete, or fails. Invoked asynchronously on the main thread in the future. + /// - Parameter authorizationCode: The authorization code used to perform the revocation. @available(iOS 13, tvOS 13, macOS 10.15, macCatalyst 13, watchOS 7, *) open func revokeToken(withAuthorizationCode authorizationCode: String) async throws { return try await withCheckedThrowingContinuation { continuation in diff --git a/FirebaseAuth/Sources/Swift/AuthProvider/FederatedAuthProvider.swift b/FirebaseAuth/Sources/Swift/AuthProvider/FederatedAuthProvider.swift index 419f87f06af..5a94b8d0861 100644 --- a/FirebaseAuth/Sources/Swift/AuthProvider/FederatedAuthProvider.swift +++ b/FirebaseAuth/Sources/Swift/AuthProvider/FederatedAuthProvider.swift @@ -22,6 +22,9 @@ import Foundation /// Used to obtain an auth credential via a mobile web flow. /// This method is available on iOS only. /// - Parameter uiDelegate: An optional UI delegate used to present the mobile web flow. + /// - Parameter completionHandler: Optionally; a block which is invoked asynchronously on the + /// main + /// thread when the mobile web flow is completed. @available(iOS 13, tvOS 13, macOS 10.15, watchOS 8, *) @objc(getCredentialWithUIDelegate:completion:) func credential(with uiDelegate: AuthUIDelegate?) async throws -> AuthCredential diff --git a/FirebaseAuth/Sources/Swift/AuthProvider/OAuthProvider.swift b/FirebaseAuth/Sources/Swift/AuthProvider/OAuthProvider.swift index c14fed69031..d0f9a476c21 100644 --- a/FirebaseAuth/Sources/Swift/AuthProvider/OAuthProvider.swift +++ b/FirebaseAuth/Sources/Swift/AuthProvider/OAuthProvider.swift @@ -86,7 +86,6 @@ import Foundation /// - Parameter providerID: The provider ID of the IDP for which this auth provider instance will /// be configured. /// - Parameter auth: The auth instance to be associated with the OAuthProvider instance. - /// - Returns: An instance of OAuthProvider corresponding to the specified provider ID. public init(providerID: String, auth: Auth = Auth.auth()) { if auth.requestConfiguration.emulatorHostAndPort == nil { if providerID == FacebookAuthProvider.id { @@ -126,7 +125,6 @@ import Foundation /// - Parameter providerID: The provider ID of the IDP for which this auth provider instance will /// be configured. /// - Parameter auth: The auth instance to be associated with the OAuthProvider instance. - /// - Returns: An instance of OAuthProvider corresponding to the specified provider ID. public convenience init(providerID: AuthProviderID, auth: Auth = Auth.auth()) { self.init(providerID: providerID.rawValue, auth: auth) } @@ -339,6 +337,9 @@ import Foundation /// Used to obtain an auth credential via a mobile web flow. /// This method is available on iOS only. /// - Parameter uiDelegate: An optional UI delegate used to present the mobile web flow. + /// - Parameter completionHandler: Optionally; a block which is invoked asynchronously on the + /// main + /// thread when the mobile web flow is completed. @available(iOS 13, tvOS 13, macOS 10.15, watchOS 8, *) @objc(getCredentialWithUIDelegate:completion:) @MainActor diff --git a/FirebaseAuth/Sources/Swift/MultiFactor/MultiFactor.swift b/FirebaseAuth/Sources/Swift/MultiFactor/MultiFactor.swift index 8920da00ad1..f3dd5b26981 100644 --- a/FirebaseAuth/Sources/Swift/MultiFactor/MultiFactor.swift +++ b/FirebaseAuth/Sources/Swift/MultiFactor/MultiFactor.swift @@ -172,7 +172,6 @@ import Foundation /// - Parameter assertion: The `MultiFactorAssertion`. /// - Parameter displayName: An optional display name associated with the multi factor to /// enroll. - /// - Parameter completion: The block invoked when the request is complete, or fails. @available(iOS 13, tvOS 13, macOS 10.15, macCatalyst 13, watchOS 7, *) open func enroll(with assertion: MultiFactorAssertion, displayName: String?) async throws { return try await withCheckedThrowingContinuation { continuation in @@ -187,6 +186,7 @@ import Foundation } /// Unenroll the given multi factor. + /// - Parameter factorInfo: The second factor instance to unenroll. /// - Parameter completion: The block invoked when the request to send the verification email is /// complete, or fails. @objc(unenrollWithInfo:completion:) @@ -202,6 +202,8 @@ import Foundation } /// Unenroll the given multi factor. + /// - Parameter factorUID: The unique identifier corresponding to the + /// second factor being unenrolled. /// - Parameter completion: The block invoked when the request to send the verification email is /// complete, or fails. @objc(unenrollWithFactorUID:completion:) diff --git a/FirebaseAuth/Sources/Swift/MultiFactor/MultiFactorResolver.swift b/FirebaseAuth/Sources/Swift/MultiFactor/MultiFactorResolver.swift index a9936928fec..64b8bdda693 100644 --- a/FirebaseAuth/Sources/Swift/MultiFactor/MultiFactorResolver.swift +++ b/FirebaseAuth/Sources/Swift/MultiFactor/MultiFactorResolver.swift @@ -34,8 +34,8 @@ import Foundation @objc public let auth: Auth /// A helper function to help users complete sign in with a second factor using a - /// `MultiFactorAssertion` confirming the user successfully completed the second factor - /// challenge. + /// - Parameter assertion: The assertion confirming the user successfully + /// completed the second factor challenge. /// - Parameter completion: The block invoked when the request is complete, or fails. @objc(resolveSignInWithAssertion:completion:) open func resolveSignIn(with assertion: MultiFactorAssertion, @@ -90,8 +90,8 @@ import Foundation } /// A helper function to help users complete sign in with a second factor using a - /// `MultiFactorAssertion` confirming the user successfully completed the second factor - /// challenge. + /// - Parameter assertion: The assertion confirming the user successfully + /// completed the second factor challenge. @available(iOS 13, tvOS 13, macOS 10.15, macCatalyst 13, watchOS 7, *) open func resolveSignIn(with assertion: MultiFactorAssertion) async throws -> AuthDataResult { return try await withCheckedThrowingContinuation { continuation in diff --git a/FirebaseAuth/Sources/Swift/User/User.swift b/FirebaseAuth/Sources/Swift/User/User.swift index 0100fedfdc6..94d1c13dd0a 100644 --- a/FirebaseAuth/Sources/Swift/User/User.swift +++ b/FirebaseAuth/Sources/Swift/User/User.swift @@ -251,7 +251,7 @@ extension User: NSSecureCoding {} /// sensitive operation that requires a recent login from the user. This error indicates /// the user has not signed in recently enough. To resolve, reauthenticate the user by /// calling `reauthenticate(with:)`. - /// - Parameter phoneNumberCredential: The new phone number credential corresponding to the + /// - Parameter credential: The new phone number credential corresponding to the /// phone number to be added to the Firebase account, if a phone number is already linked to the /// account this new phone number will replace it. @available(iOS 13, tvOS 13, macOS 10.15, macCatalyst 13, watchOS 7, *) @@ -766,8 +766,6 @@ extension User: NSSecureCoding {} /// - Parameter uiDelegate: Optionally an instance of a class conforming to the `AuthUIDelegate` /// protocol used for presenting the web context. If nil, a default `AuthUIDelegate` /// will be used. - /// - Parameter completion: Optionally; a block which is invoked when the link flow finishes, or - /// is canceled. Invoked asynchronously on the main thread in the future. /// - Returns: An AuthDataResult. @available(iOS 13, tvOS 13, macOS 10.15, macCatalyst 13, watchOS 7, *) @discardableResult @@ -1028,7 +1026,7 @@ extension User: NSSecureCoding {} } /// Send an email to verify the ownership of the account then update to the new email. - /// - Parameter email: The email to be updated to. + /// - Parameter newEmail: The email to be updated to. /// - Parameter actionCodeSettings: An `ActionCodeSettings` object containing settings related to /// handling action codes. @available(iOS 13, tvOS 13, macOS 10.15, macCatalyst 13, watchOS 7, *) From 96aaf9afc230ea93e48052a212a79386aa7f814e Mon Sep 17 00:00:00 2001 From: Nick Cooke Date: Tue, 5 Nov 2024 12:35:17 -0500 Subject: [PATCH 2/2] [skip ci] review --- .../Sources/Swift/AuthProvider/FederatedAuthProvider.swift | 6 +++--- FirebaseAuth/Sources/Swift/AuthProvider/OAuthProvider.swift | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/FirebaseAuth/Sources/Swift/AuthProvider/FederatedAuthProvider.swift b/FirebaseAuth/Sources/Swift/AuthProvider/FederatedAuthProvider.swift index 5a94b8d0861..0399b0584ec 100644 --- a/FirebaseAuth/Sources/Swift/AuthProvider/FederatedAuthProvider.swift +++ b/FirebaseAuth/Sources/Swift/AuthProvider/FederatedAuthProvider.swift @@ -22,9 +22,9 @@ import Foundation /// Used to obtain an auth credential via a mobile web flow. /// This method is available on iOS only. /// - Parameter uiDelegate: An optional UI delegate used to present the mobile web flow. - /// - Parameter completionHandler: Optionally; a block which is invoked asynchronously on the - /// main - /// thread when the mobile web flow is completed. + /// - Parameter completionHandler: Optionally; a block which is invoked + /// asynchronously on the main thread when the mobile web flow is + /// completed. @available(iOS 13, tvOS 13, macOS 10.15, watchOS 8, *) @objc(getCredentialWithUIDelegate:completion:) func credential(with uiDelegate: AuthUIDelegate?) async throws -> AuthCredential diff --git a/FirebaseAuth/Sources/Swift/AuthProvider/OAuthProvider.swift b/FirebaseAuth/Sources/Swift/AuthProvider/OAuthProvider.swift index d0f9a476c21..01437d49891 100644 --- a/FirebaseAuth/Sources/Swift/AuthProvider/OAuthProvider.swift +++ b/FirebaseAuth/Sources/Swift/AuthProvider/OAuthProvider.swift @@ -337,9 +337,9 @@ import Foundation /// Used to obtain an auth credential via a mobile web flow. /// This method is available on iOS only. /// - Parameter uiDelegate: An optional UI delegate used to present the mobile web flow. - /// - Parameter completionHandler: Optionally; a block which is invoked asynchronously on the - /// main - /// thread when the mobile web flow is completed. + /// - Parameter completionHandler: Optionally; a block which is invoked + /// asynchronously on the main thread when the mobile web flow is + /// completed. @available(iOS 13, tvOS 13, macOS 10.15, watchOS 8, *) @objc(getCredentialWithUIDelegate:completion:) @MainActor