Skip to content

App Rejected Due to Apple Login #3795

Closed
@mehroozkhan

Description

@mehroozkhan

Describe the bug

Our app has been rejected from app store multiple times because apple team keep getting error when they try Apple Login.
Message From Apple Review Team on every build submission is:

The app exhibited one or more bugs that would negatively impact App Store users.
Bug description: Sign in with Apple process failed to proceed.
Review device details:

  • Device type: iPad Air (5th generation)
  • OS version: iOS 17.5.1

Attachment:
Screenshot-0724-153544

We have tested our apps in development mode and in Test Flight multiple times with different apple accounts, never got any error.
On Investigating the Amplify Error code, it is the AuthError.InvalidState error.

Login Code:
`func socialSignInWithWebUI(provider: AuthProvider?) async {

    let signInResult: AuthSignInResult
    do {
        if let provider = provider {
            signInResult = try await Amplify.Auth.signInWithWebUI(for: provider,presentationAnchor: self.view.window!)
        } else {
            signInResult = try await Amplify.Auth.signInWithWebUI(presentationAnchor: self.view.window!)
        }
        
        if signInResult.isSignedIn {
            
            let userInfo = try? await Amplify.Auth.getCurrentUser()
            
            onLogin?(userInfo?.username, nil)
            
        }
    } catch {
        print("Unexpected error: \(error)")
        self.viewModel.showLoader.value = false
        self.viewModel.alertMessage.value = AlertMessage(title: "Error", body: error.localizedDescription)
    }
}`

Also tried with the .preferPrivateSession() option, still rejected with this too.

Steps To Reproduce

We can't reproduce it on our end.

Expected behavior

Apple Review team successfully login and approve the app.

Amplify Framework Version

2.35.4

Amplify Categories

Auth

Dependency manager

Swift PM

Swift version

5.10

CLI version

12.10.1

Xcode version

15.4

Relevant log output

<details>
<summary>Log Messages</summary>


INSERT LOG MESSAGES HERE
```

Is this a regression?

No

Regression additional context

No response

Platforms

iOS

OS Version

iOS 17.5.1

Device

iPad Air (5th generation)

Specific to simulators

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    authIssues related to the Auth categorybugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions