File tree Expand file tree Collapse file tree
FirebaseSwiftUI/FirebaseFacebookSwiftUI/Sources/Services
samples/swiftui/FirebaseSwiftUIExample/FirebaseSwiftUIExample Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -10,7 +10,8 @@ import FirebaseAuthSwiftUI
1010public extension AuthService {
1111 @discardableResult
1212 func withFacebookSignIn( scopes scopes: [ String ] ? = nil ) -> AuthService {
13- facebookProvider = FacebookProviderSwift ( scopes: scopes)
13+ facebookProvider = FacebookProviderAuthUI ( scopes: scopes)
14+ register ( provider: facebookProvider!)
1415 return self
1516 }
1617}
Original file line number Diff line number Diff line change @@ -21,7 +21,6 @@ public enum FacebookProviderError: Error {
2121 case authenticationToken( String )
2222}
2323
24-
2524public class FacebookProviderAuthUI : FacebookProviderAuthUIProtocol {
2625 public let id : String = " facebook "
2726 let scopes : [ String ]
@@ -36,7 +35,7 @@ public class FacebookProviderAuthUI: FacebookProviderAuthUIProtocol {
3635 rawNonce = CommonUtils . randomNonce ( )
3736 shaNonce = CommonUtils . sha256Hash ( of: rawNonce)
3837 }
39-
38+
4039 @MainActor public func authButton( ) -> AnyView {
4140 AnyView ( SignInWithFacebookButton ( ) )
4241 }
Original file line number Diff line number Diff line change @@ -35,11 +35,11 @@ struct ContentView: View {
3535 phoneAuthProvider: phoneAuthProvider
3636 )
3737 . withGoogleSignIn ( )
38+ . withFacebookSignIn ( )
3839 }
3940
4041 var body : some View {
4142 AuthPickerView {
42- SignInWithFacebookButton ( )
4343 PhoneAuthButtonView ( )
4444 } . environment ( authService)
4545 }
You can’t perform that action at this time.
0 commit comments