Skip to content

Commit 8cea58f

Browse files
chore: rename protocols and providers
1 parent 1853f80 commit 8cea58f

File tree

6 files changed

+18
-18
lines changed

6 files changed

+18
-18
lines changed

FirebaseSwiftUI/FirebaseAuthSwiftUI/Sources/Services/AuthService.swift

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
@preconcurrency import FirebaseAuth
22
import SwiftUI
33

4-
public protocol GoogleProviderProtocol {
4+
public protocol GoogleProviderAuthUIProtocol {
55
func handleUrl(_ url: URL) -> Bool
66
@MainActor func signInWithGoogle(clientID: String) async throws -> AuthCredential
77
}
88

9-
public protocol FacebookProviderProtocol {
9+
public protocol FacebookProviderAuthUIProtocol {
1010
@MainActor func signInWithFacebook(isLimitedLogin: Bool) async throws -> AuthCredential
1111
}
1212

13-
public protocol PhoneAuthProviderProtocol {
13+
public protocol PhoneAuthProviderAuthUIProtocol {
1414
@MainActor func verifyPhoneNumber(phoneNumber: String) async throws -> String
1515
}
1616

@@ -61,9 +61,9 @@ private final class AuthListenerManager {
6161
@Observable
6262
public final class AuthService {
6363
public init(configuration: AuthConfiguration = AuthConfiguration(), auth: Auth = Auth.auth(),
64-
googleProvider: GoogleProviderProtocol? = nil,
65-
facebookProvider: FacebookProviderProtocol? = nil,
66-
phoneAuthProvider: PhoneAuthProviderProtocol? = nil) {
64+
googleProvider: GoogleProviderAuthUIProtocol? = nil,
65+
facebookProvider: FacebookProviderAuthUIProtocol? = nil,
66+
phoneAuthProvider: PhoneAuthProviderAuthUIProtocol? = nil) {
6767
self.auth = auth
6868
self.configuration = configuration
6969
self.googleProvider = googleProvider
@@ -85,11 +85,11 @@ public final class AuthService {
8585
public let passwordPrompt: PasswordPromptCoordinator = .init()
8686

8787
private var listenerManager: AuthListenerManager?
88-
private let googleProvider: GoogleProviderProtocol?
89-
private let facebookProvider: FacebookProviderProtocol?
90-
private let phoneAuthProvider: PhoneAuthProviderProtocol?
88+
private let googleProvider: GoogleProviderAuthUIProtocol?
89+
private let facebookProvider: FacebookProviderAuthUIProtocol?
90+
private let phoneAuthProvider: PhoneAuthProviderAuthUIProtocol?
9191

92-
private var safeGoogleProvider: GoogleProviderProtocol {
92+
private var safeGoogleProvider: GoogleProviderAuthUIProtocol {
9393
get throws {
9494
guard let provider = googleProvider else {
9595
throw AuthServiceError
@@ -99,7 +99,7 @@ public final class AuthService {
9999
}
100100
}
101101

102-
private var safeFacebookProvider: FacebookProviderProtocol {
102+
private var safeFacebookProvider: FacebookProviderAuthUIProtocol {
103103
get throws {
104104
guard let provider = facebookProvider else {
105105
throw AuthServiceError
@@ -109,7 +109,7 @@ public final class AuthService {
109109
}
110110
}
111111

112-
private var safePhoneAuthProvider: PhoneAuthProviderProtocol {
112+
private var safePhoneAuthProvider: PhoneAuthProviderAuthUIProtocol {
113113
get throws {
114114
guard let provider = phoneAuthProvider else {
115115
throw AuthServiceError

FirebaseSwiftUI/FirebaseFacebookSwiftUI/Sources/Services/FacebookProviderSwift.swift renamed to FirebaseSwiftUI/FirebaseFacebookSwiftUI/Sources/Services/FacebookProviderAuthUI.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public enum FacebookProviderError: Error {
2020
case authenticationToken(String)
2121
}
2222

23-
public class FacebookProviderSwift: FacebookProviderProtocol {
23+
public class FacebookProviderAuthUI: FacebookProviderAuthUIProtocol {
2424
let scopes: [String]
2525
let shortName = "Facebook"
2626
let providerId = "facebook.com"

FirebaseSwiftUI/FirebaseGoogleSwiftUI/Sources/Services/GoogleProviderSwift.swift renamed to FirebaseSwiftUI/FirebaseGoogleSwiftUI/Sources/Services/GoogleProviderAuthUI.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public enum GoogleProviderError: Error {
1212
case user(String)
1313
}
1414

15-
public class GoogleProviderSwift: @preconcurrency GoogleProviderProtocol {
15+
public class GoogleProviderAuthUI: @preconcurrency GoogleProviderAuthUIProtocol {
1616
let scopes: [String]
1717
let shortName = "Google"
1818
let providerId = "google.com"

FirebaseSwiftUI/FirebasePhoneAuthSwiftUI/Sources/Services/PhoneAuthProviderSwift.swift renamed to FirebaseSwiftUI/FirebasePhoneAuthSwiftUI/Sources/Services/PhoneAuthProviderAuthUI.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import FirebaseAuthSwiftUI
33

44
public typealias VerificationID = String
55

6-
public class PhoneAuthProviderSwift: @preconcurrency PhoneAuthProviderProtocol {
6+
public class PhoneAuthProviderAuthUI: @preconcurrency PhoneAuthProviderAuthUIProtocol {
77
public init() {}
88

99
@MainActor public func verifyPhoneNumber(phoneNumber: String) async throws -> VerificationID {

samples/swiftui/FirebaseSwiftUIExample/FirebaseSwiftUIExample/ContentView.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ struct ContentView: View {
2828
shouldAutoUpgradeAnonymousUsers: true,
2929
emailLinkSignInActionCodeSettings: actionCodeSettings
3030
)
31-
let facebookProvider = FacebookProviderSwift()
32-
let phoneAuthProvider = PhoneAuthProviderSwift()
31+
let facebookProvider = FacebookProviderAuthUI()
32+
let phoneAuthProvider = PhoneAuthProviderAuthUI()
3333
authService = AuthService(
3434
configuration: configuration,
3535
googleProvider: googleProvider,

samples/swiftui/FirebaseSwiftUIExample/FirebaseSwiftUIExample/FirebaseSwiftUIExampleApp.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import Foundation
1212
import SwiftData
1313
import SwiftUI
1414

15-
let googleProvider = GoogleProviderSwift()
15+
let googleProvider = GoogleProviderAuthUI()
1616

1717
class AppDelegate: NSObject, UIApplicationDelegate {
1818
func application(_ application: UIApplication,

0 commit comments

Comments
 (0)