Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

isNewUser always return for false for Microsoft and Twitter Sign In #1737

Closed
ian-sayles opened this issue Feb 14, 2020 · 1 comment
Closed

Comments

@ian-sayles
Copy link

Android

Step 2: Describe your environment

  • Android device: Sony ZX3

  • Android OS version: 9

  • Google Play Services version: 20.1.04

  • Firebase/Play Services SDK version:
    com.google.firebase:firebase-auth:19.2.0
    com.google.gms:google-services:4.3.3

  • FirebaseUI version: com.google.firebase:firebase-auth:19.2.0

Step 3: Describe the problem:

After a new user signed into my app the "isNewUser" is only true when they have signed in using email or Google providers, both Microsoft and Twitter it is always false.

Steps to reproduce:

I have tried this on Samsung phone run from Android Studio and from an app submitted into Play Store on my Sony mobile device with the same result for both devices.

Relevant Code:

Start Sign In:

      startActivityForResult(
            AuthUI.getInstance()
                .createSignInIntentBuilder()
                .setAvailableProviders(
                    listOf(
                        GoogleBuilder().build(),
                        MicrosoftBuilder().build(),
                        EmailBuilder().build(),
                        TwitterBuilder().build()
                    )
                )
                .build(),
            SIGNIN
        )

override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
super.onActivityResult(requestCode, resultCode, data)

    if (requestCode == SIGNIN) {


        val response = IdpResponse.fromResultIntent(data)

        if (resultCode == Activity.RESULT_OK) {

            if (response == null) {
                finish()
                return
            }

            if (response.isNewUser) {

                Toast.makeText(
                    this,
                    "You are a new user",
                    Toast.LENGTH_LONG
                ).show()

                registerNewUser()


            } else {

                Toast.makeText(
                    this,
                    "You are an existing user",
                    Toast.LENGTH_LONG
                ).show()

                checkAdmin()
            }  
@samtstern
Copy link
Contributor

This has been released in version 6.4.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants