0
votes

I have successfully implemented the Firebase Authentication and have that working fine. I want to be able to send out Email verification emails and password reset emails but the code snippet I copied from Firebase Docs has the ActionCodeSettings class and it is not being recognized. I think it's supposed to be apart of the framework that comes with Firebase Auth???

   private void sendVerEmail(){
    FirebaseUser user = mAuth.getCurrentUser();
    String url = "http://www.example.com/verify?uid=" + user.getUid();

    ActionCodeSettings actionCodeSettings = ActionCodeSettings.newBuilder()
            .setUrl(url)
            .setIOSBundleId("com.example.ios")
            // The default for this is populated with the current android package name.
            .setAndroidPackageName("com.example.android", false, null)
            .build();

    user.sendEmailVerification(actionCodeSettings)
            .addOnCompleteListener(new OnCompleteListener<Void>() {
                @Override
                public void onComplete(@NonNull Task<Void> task) {
                    if (task.isSuccessful()) {
                        Log.d(TAG, "Email sent.");
                    }
                }
            });
}
1
ActionCodeSettings is red in my project and does not give me any option to import the class. I'm simply just practicing so the code is generic. But I want to be able to implement it in my future app I am working on.Casey

1 Answers

0
votes

You must be using an old version when this class was not supported. This was added to SDK Version 11.4.0: https://firebase.google.com/support/release-notes/android#20170918

Better upgrade to the latest version.