0

Using Android Studio and Andoridx I am trying to import the following class

import com.google.firebase.auth.ProviderQueryResult;

the Error I get is

Cannot Resolve symbol 'ProviderQueryResult'

I need to check to see if the email is not already present in the database Using but cannot execute because the** import com.google.firebase.auth.ProviderQueryResult;** is Not Working.

                                         @Override
                                         public void onComplete(@NonNullTask<ProviderQueryResult>task{
                                             if (task.isSuccessful()) {
                                                  getProviders().size() will return size 1 if email ID is in use.
                                                 Log.d(TAG, "onComplete: RESULT: " + task.getResult().getProviders().size());
                                                 if (task.getResult().getProviders().size() == 1) {
                                                     Log.d(TAG, "onComplete: That email is already in use.");
                                                     hideDialog();
                                                     Toast.makeText(SettingsActivity.this, "That email is already in use", Toast.LENGTH_SHORT).show();} 
else {
                                                     Log.d(TAG, "onComplete: That email is available.");
} 

I tried - invalidate catches and restart but no Changes

1 Answers1

0

According to the official documentation, the ProviderQueryResult interface is deprecated:

This interface is deprecated. In favor of SignInMethodQueryResult Result object that contains a list of strings that represent authentication provider IDs. For example, PROVIDER_ID or PROVIDER_ID.

Moreover, the ProviderQueryResult interface is not apart of the com.google.firebase.auth package anymore, hence that error. Here's the solution:

But instead of phone number, check against the email address.

Alex Mamo
  • 130,605
  • 17
  • 163
  • 193