roughike / flutter_facebook_login

A Flutter plugin for allowing users to authenticate with native Android & iOS Facebook login SDKs.
BSD 2-Clause "Simplified" License
405 stars 331 forks source link

how to get email/credential object to linked multiple provider #218

Open premtemp1 opened 4 years ago

premtemp1 commented 4 years ago

Hello, I need to support linking in my App. However, this plugin does not return the email address credentials used to login to facebook if there is a conflict.

Here is an example 1:User login with Google/firebase. The account is created and user logs off 2: The same user now tried to log in with FB with the same email above -- result --error email already in use

code:"ERROR_ACCOUNT_EXISTS_WITH_DIFFERENT_CREDENTIAL" details:null message: "An account already exists with the same email address but different sign-in credentials. Sign in using a provider associated with this email address., null))

I need the email address ( credential object) that the user used to log in previously. This is needed to link the account.

Thanks

rphlmr commented 4 years ago

Hi,

You should try this : https://github.com/roughike/flutter_facebook_login#getting-the-facebook-profile-of-a-signed-in-user

Facebook did not give you the email, just a token ;)