-
Notifications
You must be signed in to change notification settings - Fork 483
Open
Description
Similar to #1198
I use the FirebaseAuthUI in SwiftUI. I wrapped it in a UIViewControllerRepresentable and implemented the makeCoordinator
method to set the delegate like the following
struct AuthView: View {
var body: some View {
AuthViewControllerRepresentable()
}
}
struct AuthViewControllerRepresentable: UIViewControllerRepresentable {
...
func makeCoordinator() -> Coordinator {
Coordinator()
}
func makeUIViewController(context: Context) -> UINavigationController {
let authUI = FUIAuth.defaultAuthUI()!
authUI.delegate = context.coordinator
...
}
class Coordinator: NSObject, FUIAuthDelegate {
func authUI(
_ authUI: FUIAuth, didSignInWith authDataResult: AuthDataResult?, error: Error?
) {
print("authUI called")
}
}
}
The FUIAuthDelegate is not called if it is activated inside a .sheet
like the following
.sheet(isPresented: $showAuthViewSheet) {
AuthView()
}
However, the FUIAuthDelegate method will get called if it is a stand alone page.
I'm using v14.2.6
Metadata
Metadata
Assignees
Labels
No labels