0

My task requires of me to ask an account verification inside the App, so I use sendEmailVerification with ActionCodeSettings as fallowed:

ActionCodeSettings settings = ActionCodeSettings.newBuilder()
                .setAndroidPackageName("***", false, null)
                .setHandleCodeInApp(true)
                .setUrl(url)
                .build();
...
user.sendEmailVerification(settings)...

Then I get the dynamic link:

FirebaseDynamicLinks.getInstance().getDynamicLink(getIntent()).addOnSuccessListener

All works as it should, but when I check if the user is verified:

user.reload().addOnCompleteListener(task -> if (user.isEmailVerified())...)

it returns false. Am I doing something wrong? Should I somehow set the user as verified manually?

Nickolay M.
  • 140
  • 3
  • 9

2 Answers2

0

After you get the dynamic link, you would parse the deep link using FDL library. You then parse the code (oobCode) and call auth.applyActionCode(actionCode). This would complete verification. You can then call reload() on the user to pick the changes. Check this documentation for how to do it on web which is similar to Android: https://firebase.google.com/docs/auth/custom-email-handler

bojeil
  • 29,642
  • 4
  • 69
  • 76
  • Thanks a lot again! I'll try to implement this in my project. I wish, guys from firebase would've described this approach in the Android section of the Guides. – Nickolay M. Nov 16 '17 at 08:20
0

For get correct 'oobCode', when you handle the URL in the App, make sure, that you are decoding URL from UTF-8. Because it has other symbols in the URL query.

Ihor Chernysh
  • 446
  • 4
  • 5