Apple Sign In Button does not work properly

So guys I have this apple sign in button but I have two major problems.

1 - After I click on sign in and enter the pass, the animation stuck at the scroll and make me wait forever which does not result in a successful login.

2 - Cant have the only Apple icon on it.

SignInWithAppleButton(

                .signIn,

                onRequest: { request in

                    // 1

                    request.requestedScopes = [.fullName, .email]

                },

                

                onCompletion: { result in

                    switch result {

                    case .success (let authResults):

                        // 2

                        print("Authorization successful.")

                    case .failure (let error):

                        // 3

                        print("Authorization failed: " + error.localizedDescription)

                    }

                }

                

        ).signInWithAppleButtonStyle(colorScheme == .dark ? .white : .black).frame(width: UIScreen.main.bounds.width * 0.18, height: UIScreen.main.bounds.height * 0.08).cornerRadius(16)

This only tells half or less of the story. What is the button nested in? More code is needed to see what is actually causing the problem.

What do you mean by nesting? Can you give us a working example of a logo-only Apple sign-in button?

The recent try is in new comment

NavigationLink(destination: HomeView().navigationBarBackButtonHidden(true).navigationBarHidden(true), isActive: $isActive2){

                            SignInWithAppleButton(.continue) {request in



                                request.requestedScopes = [.email, .fullName]

                                

                            } onCompletion: { result in

                                

                                switch result {

                                    

                                case .success(let auth):

                                    

                                    switch auth.credential {

                                    case let credential as ASAuthorizationAppleIDCredential:

                                 

                                        

                                        

                                        

                                        

                                        let email = credential.email

                                        let firstName = credential.fullName?.givenName

                                        let lastName = credential.fullName?.familyName

                                        let userId = credential.user

                                        

                                        self.email = email ?? ""

                                        self.userId = userId ?? ""

                                        self.firstName = firstName ?? ""

                                        self.lastName = lastName ?? ""

                                        

                                        

                                      

                                    default:

                                        break

                                    }

                                    

                                case .failure(let error):

                                    print(error.localizedDescription)

                                }

                                

                            } .frame(width: UIScreen.main.bounds.width * 0.18, height: UIScreen.main.bounds.height * 0.08).signInWithAppleButtonStyle(colorScheme == .dark ? .white : .black).cornerRadius(16)

                            

                  

                    }

The following and your code above works perfectly fine on a real device, not the simulator:

        VStack {
            SignInWithAppleButton(.continue) { request in
                request.requestedScopes = [.email, .fullName]
            } onCompletion: { result in
                switch result {
                case .success(let auth):
                    guard let credential = auth.credential as? ASAuthorizationAppleIDCredential,
                    let email = credential.email else { return }
                    print("\(email)")
                case .failure(let error):
                    print(error.localizedDescription)
                }
            }
        }.frame(width: 80, height: 28, alignment: .center)
Apple Sign In Button does not work properly
 
 
Q