[iOS] Unable to login using Facebook authentication #60
Comments
Can you try adding this bit to |
@EddyVerbruggen - That did work. However, the e-mail never gets recorded:
|
I'm not sure that's expected anyway.. what does the Firebase documentation say? |
@EddyVerbruggen - According to this post of yours, you got the email attached? I googled a little and found this. It says (although from the Firebase web API) that this needs to be included in the auth process:
Specifically referring to the scope property there. Could that be it? The Facebook login page should basically say this: Taken from this video tutorial. |
Email is already in the request and that screenshot has an email address because it was added by the 'login by email' type which was merged with the Facebook login (see the envelope above the Facebook logo). So perhaps Firebase doesn't store the email in the console, but do you also not see the emailaddress in the login callback of the Facebook login? (not sure it should, I don't have access to my test app currently) |
Interesting... Well, as stated in a previous post, this is the callback from Facebook login:
Email is The Facebook login does ask for the public profile and e-mail address (screenshot in Swedish), but the callback returns As for your email adress being merged from previous email/password account. This is my result of it: My Facebook uses the same e-mail address as the other one marked in red. Firebase created a new account because the e-mail was, for some reason, never received. |
I found the issue and it seems to be a problem with Firebase itself. I had to check "One account per email address" in the Firebase Sign-in Method page. That way the email property will get the e-mail address. Though I still think it is weird that you managed to combined the accounts together 🤔 |
I had that option checked from the get go. This particular user was already registered via email and later logged on via Facebook with the same email address. Then this line of code kicked in and linked the two. |
@EddyVerbruggen Ah, I see! However, I got the alert/error "email already in use" (or something like that) if I already had an account with the same email address (pretty sure that's what the option is for - to prevent double accounts). This solved my issue though. So thank you for your help! |
If you feel this needs to be documented in the readme, or is useful for others to know, please send a PR for the readme. Happy coding! |
Using the latest plugin version. The login procedure will redirect me to the Facebook login page in Safari. After I sign in and accept, it redirects me to a blank page. I can only tap on "Done" in the upper left corner and a popup will say "login cancelled".
I have added the necessary lines in info.plist as Facebook stated when creating the app. Firebase config has also Facebook auth enabled with the correct API key and such.
The text was updated successfully, but these errors were encountered: