Android App Development | Lecture#35 | Hive Learners

in Hive Learners2 months ago

𝓖𝓻𝓮𝓮𝓽𝓲𝓷𝓰𝓼

Greeting, Dear community members, In our 34th lecture we learn how to use FirebaseAuth to sign in as a user with an email and password. Sometimes we need a security checkup that if the email is owned by the user or not. We will use Email Verification for this. Firebase will send a verification email to the user's email. If the user clicks on the link then the email gets verified and we can use whether the method is email verified or not. So let's get started.

GitHub Link

Use this GitHub project to clone into your directory. The following lecture will constantly update it so you will never miss the latest code. Happy Coding!

What Should I Learn

  • Send firebase email verification link
  • Check if the email is verified or not

Assignment

  • Check if the email is verified or not before the first sign-in.

Procedure

We will add email verification to the sign-in activity. After the successful login, our system will check if the email is verified or not. If the email is not verified then our system will send a verification link to the user.

But if the email is already verified then our system will open the Welcome Activity. First, we check if the email is verified or not.

Now move the code in the email verified part. Because in the last lecture we write the code to send the user to the next screen.

In the else, we will alert the user that the account is not verified and show a button a send the verification link. On VERIFY button click system will send the Verification link to the user email. We will show the Toast message for a Long duration.

Now, let's run the and check if we are getting the verification link or not.

I got the Verification link in the Spam folder. We can make it not spam by some setting in the firebase. We will do it in the future.


hl_divider.png

Thank You

hl_footer_banner.png

Sort:  

Yay! 🤗
Your content has been boosted with Ecency Points, by @faisalamin.
Use Ecency daily to boost your growth on platform!

Support Ecency
Vote for new Proposal
Delegate HP and earn more

Thanks for your contribution to the STEMsocial community. Feel free to join us on discord to get to know the rest of us!

Please consider delegating to the @stemsocial account (85% of the curation rewards are returned).

You may also include @stemsocial as a beneficiary of the rewards of this post to get a stronger support.