Firebase does not work with multiple apps

Asked

Viewed 201 times

0

all right?

I started a project in Firebase and Linkei two related applications in the same project.

I made an equal login/signin system for both. It turns out that for an app, Sign in works normal but for the second app, when I click register the app never completes the response. The method for Sign in is equal in both:

 public void bntRegistrarRClick(View v)
    {
        (firebaseAuth.createUserWithEmailAndPassword(txtEmail.getText().toString(), txtSenha.getText().toString())).
                addOnCompleteListener(new OnCompleteListener<AuthResult>() {
                    @Override
                    public void onComplete(@NonNull Task<AuthResult> task) {
                        if(task.isSuccessful())
                        {
                            Toast.makeText(RegistroActivity.this, "Registrado com Sucesso", Toast.LENGTH_LONG).show();
                            Intent i = new Intent(RegistroActivity.this, CreateProfileActivity.class);
                            startActivity(i);
                        }
                        else
                        {
                            Log.e("ERROR", task.getException().toString());
                            Toast.makeText(RegistroActivity.this, task.getException().getMessage(), Toast.LENGTH_LONG).show();
                        }
                    }
                });

    }

Does anyone have any idea what the problem is?

2 answers

0


I appreciate the comment, maybe I didn’t explain myself very well! What I wanted was for two apps to connect at the same bank which I was unable to do.

The problem was that I had put the apps in different projects of Android Studio and in fact they should be in the same project with different modules.

0

Go to the firebase panel -> Authentication ->Login methods -> Multiple accounts per email address is to enable the option so the same email can log in several times. Follow in the user area to see the result.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.