Skip to content

Commit 9355939

Browse files
committed
fix build errors
1 parent 6639a43 commit 9355939

File tree

7 files changed

+27
-13
lines changed

7 files changed

+27
-13
lines changed

FirebaseSwiftUI/FirebaseAuthSwiftUI/Sources/Services/AuthService.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ public protocol ExternalAuthProvider {
66
}
77

88
public protocol GoogleProviderProtocol: ExternalAuthProvider {
9-
func handleUrl(_ url: URL) -> Bool
109
@MainActor func signInWithGoogle(clientID: String) async throws -> AuthCredential
1110
}
1211

FirebaseSwiftUI/FirebaseAuthSwiftUI/Sources/Strings/Localizable.xcstrings

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -405,6 +405,9 @@
405405
}
406406
}
407407
}
408+
},
409+
"Enter Password" : {
410+
408411
},
409412
"EnterYourEmail" : {
410413
"comment" : "Title for email entry screen, email text field placeholder. Use short/abbreviated translation for 'email' which is less than 15 chars.",
@@ -933,6 +936,9 @@
933936
}
934937
}
935938
}
939+
},
940+
"Submit" : {
941+
936942
},
937943
"TermsOfService" : {
938944
"comment" : "Text linked to a web page with the Terms of Service content.",

FirebaseSwiftUI/FirebaseFacebookSwiftUI/Sources/Services/FacebookProviderSwift.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public class FacebookProviderSwift: FacebookProviderProtocol {
3636
}
3737

3838
@MainActor public var authButton: any View {
39-
return FacebookButtonView()
39+
return SignInWithFacebookButton()
4040
}
4141

4242
@MainActor public func signInWithFacebook(isLimitedLogin: Bool) async throws -> AuthCredential {

FirebaseSwiftUI/FirebaseGoogleSwiftUI/Sources/Services/AuthService+Google.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77

88
import FirebaseAuthSwiftUI
99

10-
extension AuthService {
10+
public extension AuthService {
1111

1212
@discardableResult
13-
func withGoogleSignIn() -> AuthService {
13+
public func withGoogleSignIn() -> AuthService {
1414
let clientID = auth.app?.options.clientID ?? ""
1515
self.googleProvider = GoogleProviderSwift(clientID: clientID)
1616
return self

FirebaseSwiftUI/FirebaseGoogleSwiftUI/Sources/Services/GoogleProviderSwift.swift

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
@preconcurrency import FirebaseAuth
22
import FirebaseAuthSwiftUI
3+
import FirebaseCore
34
import GoogleSignIn
45
import GoogleSignInSwift
56
import SwiftUI
@@ -19,15 +20,11 @@ public class GoogleProviderSwift: @preconcurrency GoogleProviderProtocol {
1920
let shortName = "Google"
2021
let providerId = "google.com"
2122
let clientID: String
22-
public init(scopes: [String]? = nil, clientID: String) {
23+
public init(scopes: [String]? = nil, clientID: String = FirebaseApp.app()!.options.clientID!) {
2324
self.scopes = scopes ?? kDefaultScopes
2425
self.clientID = clientID
2526
}
2627

27-
public func handleUrl(_ url: URL) -> Bool {
28-
return GIDSignIn.sharedInstance.handle(url)
29-
}
30-
3128
@MainActor public var authButton: any View {
3229
return GoogleSignInButton {
3330
Task {

FirebaseSwiftUI/FirebasePhoneAuthSwiftUI/Sources/Services/PhoneAuthProviderSwift.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
11
@preconcurrency import FirebaseAuth
22
import FirebaseAuthSwiftUI
3+
import SwiftUI
34

45
public typealias VerificationID = String
56

67
public class PhoneAuthProviderSwift: @preconcurrency PhoneAuthProviderProtocol {
8+
9+
public var authButton: any View {
10+
// TODO: implement me
11+
return Button("Phone", action: { })
12+
}
13+
714
public init() {}
815

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

samples/swiftui/FirebaseSwiftUIExample/FirebaseSwiftUIExample/FirebaseSwiftUIExampleApp.swift

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import FirebaseCore
1212
import FirebaseFacebookSwiftUI
1313
import FirebaseGoogleSwiftUI
1414
import FirebasePhoneAuthSwiftUI
15+
import GoogleSignIn
1516
import SwiftData
1617
import SwiftUI
1718

@@ -45,15 +46,17 @@ class AppDelegate: NSObject, UIApplicationDelegate {
4546
func application(_ app: UIApplication,
4647
open url: URL,
4748
options: [UIApplication.OpenURLOptionsKey: Any] = [:]) -> Bool {
48-
ApplicationDelegate.shared.application(
49+
if ApplicationDelegate.shared.application(
4950
app,
5051
open: url,
5152
sourceApplication: options[UIApplication.OpenURLOptionsKey
5253
.sourceApplication] as? String,
5354
annotation: options[UIApplication.OpenURLOptionsKey.annotation]
54-
)
55+
) {
56+
return true
57+
}
5558

56-
return googleProvider.handleUrl(url)
59+
return GIDSignIn.sharedInstance.handle(url)
5760
}
5861
}
5962

@@ -92,10 +95,12 @@ struct ContentView: View {
9295
let phoneAuthProvider = PhoneAuthProviderSwift()
9396
authService = AuthService(
9497
configuration: configuration,
95-
googleProvider: googleProvider,
98+
googleProvider: nil,
9699
facebookProvider: facebookProvider,
97100
phoneAuthProvider: phoneAuthProvider
98101
)
102+
// Transition to this api
103+
.withGoogleSignIn()
99104
}
100105

101106
var body: some View {

0 commit comments

Comments
 (0)