Skip to content

"Unable to process request due to missing initial state" when using startActivityForSignInWithProvider with Apple sign in #6144

Open
@datvm

Description

@datvm

[REQUIRED] Step 2: Describe your environment

  • Android Studio version: N/A. Visual Studio 2022 Version 17.10.5
  • Firebase Component: Authentication
  • Component version: 22.3.1.2

[REQUIRED] Step 3: Describe the problem

Steps to reproduce:

Following Authenticate Using Apple on Android, I have this code (C# but it should be equivalent to Java):

var activity = await Platform.WaitForActivityAsync();
var provider = OAuthProvider.NewBuilder("apple.com").Build();

try
{
    var authResult = await auth.StartActivityForSignInWithProvider(activity, provider).AsAsync<IAuthResult>();
    FbUser = authResult.User;

    return authResult.Credential;
}
catch (FirebaseAuthWebException ex)
{
    if (ex.ErrorCode == "ERROR_WEB_CONTEXT_CANCELED")
    {
        return null;
    }

    throw;
}

After calling StartActivityForSignInWithProvider, an in-app browser is opened but after signing in successfully, this page opens instead:

image

Closing this page by pressing X on the top left corner also closes my app and the next time the app starts, it is stuck at the splash screen and has to be restarted.

Relevant Code:

See above.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions