Skip to content

Commit c74a354

Browse files
google provider setup for handling opening url
1 parent df0f896 commit c74a354

2 files changed

Lines changed: 7 additions & 5 deletions

File tree

FirebaseSwiftUI/FirebaseGoogleSwiftUI/Sources/FirebaseGoogleSwiftUI/FirebaseGoogleSwiftUI.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ public class GoogleProviderSwift: GoogleProviderProtocol {
99
let scopes: [String]
1010
let shortName = "Google"
1111
let providerId = "google.com"
12-
public init(scopes _: [String] = kDefaultScopes) {
13-
scopes = scopes
12+
public init(scopes: [String]? = nil) {
13+
self.scopes = scopes ?? kDefaultScopes
1414
}
1515

16-
func handleUrl(_ url: URL) -> Bool {
16+
public func handleUrl(_ url: URL) -> Bool {
1717
return GIDSignIn.sharedInstance.handle(url)
1818
}
1919
}

samples/swiftui/FirebaseSwiftUIExample/FirebaseSwiftUIExample/FirebaseSwiftUIExampleApp.swift

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

88
import FirebaseAuth
99
import FirebaseAuthSwiftUI
10-
import FirebaseGoogleSwiftUI
1110
import FirebaseCore
11+
import FirebaseGoogleSwiftUI
1212
import SwiftData
1313
import SwiftUI
1414

15+
let googleProvider = GoogleProviderSwift()
16+
1517
class AppDelegate: NSObject, UIApplicationDelegate {
1618
func application(_: UIApplication,
1719
open url: URL,
1820
options _: [UIApplication.OpenURLOptionsKey: Any] = [:]) -> Bool {
19-
return GIDSignIn.sharedInstance.handle(url)
21+
return googleProvider.handleUrl(url)
2022
}
2123
}
2224

0 commit comments

Comments
 (0)