I am just starting out with the Facebook SDK, I currently have an app that has its own login system, the user enters their email and password and then the app checks a mysql database to find the user. If the user is their it returns the user info and logs them into the app.
What I am trying to do is allow the user to just press a Facebook button and have the Facebook SDK return the users email linked to their Facebook account. Then I can search my database for that email and log the user in or create an account for them if their is no account with that email.
I have everything set up apart from having the Facebook SDK actually return the email for the user. I am not sure where to start with this and could really use some help!
You have two options to get the email of the Facebook user:
Option 1: Use Facebook SDK
email
permissionRequest.newMeRequest()
. This is explained here: PersonalizeOprion 2: Use Simple Facebook SDK library
The library: https://github.com/sromku/android-simple-facebook
email
permission by usingPermissions.EMAIL
Then, login
And then, get the profile with the
email