@@ -17,8 +17,8 @@ import Foundation
1717import FirebaseAppCheckInterop
1818import FirebaseAuthInterop
1919import FirebaseCore
20- import FirebaseCoreInternal
2120import FirebaseCoreExtension
21+ import FirebaseCoreInternal
2222#if COCOAPODS
2323 @_implementationOnly import GoogleUtilities
2424#else
@@ -82,7 +82,8 @@ extension Auth: AuthInterop {
8282 /// This method is not for public use. It is for Firebase clients of AuthInterop.
8383 @objc ( getTokenForcingRefresh: withCallback: )
8484 public func getToken( forcingRefresh forceRefresh: Bool ,
85- completion callback: @escaping @MainActor @Sendable ( String ? , Error ? ) -> Void ) {
85+ completion callback: @escaping @MainActor @Sendable ( String ? , Error ? )
86+ -> Void ) {
8687 kAuthGlobalWorkQueue. async { [ weak self] in
8788 if let strongSelf = self {
8889 // Enable token auto-refresh if not already enabled.
@@ -227,7 +228,8 @@ extension Auth: AuthInterop {
227228 /// - user: The user object to be set as the current user of the calling Auth instance.
228229 /// - completion: Optionally; a block invoked after the user of the calling Auth instance has
229230 /// been updated or an error was encountered.
230- @objc open func updateCurrentUser( _ user: User ? , completion: ( @MainActor ( Error ? ) -> Void ) ? = nil ) {
231+ @objc open func updateCurrentUser( _ user: User ? ,
232+ completion: ( @MainActor ( Error ? ) -> Void ) ? = nil ) {
231233 kAuthGlobalWorkQueue. async {
232234 guard let user else {
233235 let error = AuthErrorUtils . nullUserError ( message: nil )
@@ -707,9 +709,8 @@ extension Auth: AuthInterop {
707709 /// not enabled. Enable them in the Auth section of the Firebase console.
708710 /// - Parameter completion: Optionally; a block which is invoked when the sign in finishes, or is
709711 /// canceled. Invoked asynchronously on the main thread in the future.
710- @objc open func signInAnonymously(
711- completion: ( @MainActor ( AuthDataResult ? , Error ? ) -> Void ) ? = nil
712- ) {
712+ @objc open func signInAnonymously( completion: ( @MainActor ( AuthDataResult ? , Error ? ) -> Void ) ? =
713+ nil ) {
713714 kAuthGlobalWorkQueue. async {
714715 let decoratedCallback = self . signInFlowAuthDataResultCallback ( byDecorating: completion)
715716 if let currentUser = self . _currentUser, currentUser. isAnonymous {
@@ -1000,7 +1001,8 @@ extension Auth: AuthInterop {
10001001 /// Invoked
10011002 /// asynchronously on the main thread in the future.
10021003 @objc open func checkActionCode( _ code: String ,
1003- completion: @MainActor @escaping ( ActionCodeInfo ? , Error ? ) -> Void ) {
1004+ completion: @MainActor @escaping ( ActionCodeInfo ? , Error ? )
1005+ -> Void ) {
10041006 kAuthGlobalWorkQueue. async {
10051007 let request = ResetPasswordRequest ( oobCode: code,
10061008 newPassword: nil ,
@@ -1045,7 +1047,8 @@ extension Auth: AuthInterop {
10451047 /// - Parameter completion: Optionally; a block which is invoked when the request finishes.
10461048 /// Invoked asynchronously on the main thread in the future.
10471049 @objc open func verifyPasswordResetCode( _ code: String ,
1048- completion: @escaping @MainActor ( String ? , Error ? ) -> Void ) {
1050+ completion: @escaping @MainActor ( String ? , Error ? )
1051+ -> Void ) {
10491052 checkActionCode ( code) { info, error in
10501053 if let error {
10511054 completion ( nil , error)
@@ -1078,10 +1081,8 @@ extension Auth: AuthInterop {
10781081 /// - Parameter code: The out of band code to be applied.
10791082 /// - Parameter completion: Optionally; a block which is invoked when the request finishes.
10801083 /// Invoked asynchronously on the main thread in the future.
1081- @objc open func applyActionCode(
1082- _ code: String ,
1083- completion: @escaping @MainActor ( Error ? ) -> Void
1084- ) {
1084+ @objc open func applyActionCode( _ code: String ,
1085+ completion: @escaping @MainActor ( Error ? ) -> Void ) {
10851086 kAuthGlobalWorkQueue. async {
10861087 let request = SetAccountInfoRequest ( requestConfiguration: self . requestConfiguration)
10871088 request. oobCode = code
@@ -1393,9 +1394,9 @@ extension Auth: AuthInterop {
13931394 /// - Parameter listener: The block to be invoked. The block is always invoked asynchronously on
13941395 /// the main thread, even for it's initial invocation after having been added as a listener.
13951396 /// - Returns: A handle useful for manually unregistering the block as a listener.
1396- @objc open func addIDTokenDidChangeListener( _ listener: @MainActor @escaping ( Auth , User ? ) -> Void )
1397+ @objc open func addIDTokenDidChangeListener( _ listener: @MainActor @escaping ( Auth , User ? )
1398+ -> Void )
13971399 -> NSObjectProtocol {
1398-
13991400 let handle = NotificationCenter . default. addObserver (
14001401 forName: Auth . authStateDidChangeNotification,
14011402 object: self ,
@@ -1616,7 +1617,7 @@ extension Auth: AuthInterop {
16161617 /// the URL is for the app (or another library) so the caller should continue handling
16171618 /// this URL as usual.
16181619 @MainActor @objc ( canHandleURL: ) open func canHandle( _ url: URL ) -> Bool {
1619- guard let authURLPresenter = self . authURLPresenter as? AuthURLPresenter else {
1620+ guard let authURLPresenter = authURLPresenter as? AuthURLPresenter else {
16201621 return false
16211622 }
16221623 return authURLPresenter. canHandle ( url: url)
@@ -1889,7 +1890,8 @@ extension Auth: AuthInterop {
18891890 if let token, token. count > 0 {
18901891 internalNotificationParameters [ FIRAuthStateDidChangeInternalNotificationTokenKey] = token
18911892 }
1892- internalNotificationParameters [ FIRAuthStateDidChangeInternalNotificationUIDKey] = self . _currentUser?
1893+ internalNotificationParameters [ FIRAuthStateDidChangeInternalNotificationUIDKey] = self
1894+ . _currentUser?
18931895 . uid
18941896 let notifications = NotificationCenter . default
18951897 notifications. post ( name: NSNotification . Name. FIRAuthStateDidChangeInternal,
@@ -2251,7 +2253,8 @@ extension Auth: AuthInterop {
22512253 /// Invoked asynchronously on the main thread in the future.
22522254 /// - Returns: Returns a block that updates the current user.
22532255 func signInFlowAuthDataResultCallback( byDecorating callback:
2254- ( @MainActor ( AuthDataResult ? , Error ? ) -> Void ) ? ) -> @Sendable ( Result < AuthDataResult , Error > ) -> Void {
2256+ ( @MainActor ( AuthDataResult ? , Error ? ) -> Void ) ? )
2257+ -> @Sendable ( Result < AuthDataResult , Error > ) -> Void {
22552258 return { result in
22562259 switch result {
22572260 case let . success( authResult) :
@@ -2267,10 +2270,8 @@ extension Auth: AuthInterop {
22672270 }
22682271 }
22692272
2270- private func wrapAsyncRPCTask(
2271- _ request: any AuthRPCRequest ,
2272- _ callback: ( @MainActor ( Error ? ) -> Void ) ?
2273- ) {
2273+ private func wrapAsyncRPCTask( _ request: any AuthRPCRequest ,
2274+ _ callback: ( @MainActor ( Error ? ) -> Void ) ? ) {
22742275 Task {
22752276 do {
22762277 let _ = try await self . backend. call ( with: request)
@@ -2290,7 +2291,7 @@ extension Auth: AuthInterop {
22902291 }
22912292
22922293 class func wrapMainAsync< T: Sendable > ( callback: ( @MainActor ( T ? , Error ? ) -> Void ) ? ,
2293- with result: Result < T , Error > ) -> Void {
2294+ with result: Result < T , Error > ) -> Void {
22942295 guard let callback else { return }
22952296 DispatchQueue . main. async {
22962297 switch result {
0 commit comments