Giter VIP home page Giter VIP logo

Comments (10)

EddyVerbruggen avatar EddyVerbruggen commented on May 18, 2024

Can you try adding this bit to app.js?

from nativescript-plugin-firebase.

NordlingDev avatar NordlingDev commented on May 18, 2024

@EddyVerbruggen - That did work. However, the e-mail never gets recorded:

{
  "uid": "84gfhYMCQ5iVasdCH22A9LE0fndfg14",
  "profileImageURL": {},
  "email": null,
  "emailVerified": false,
  ...
}

image

from nativescript-plugin-firebase.

EddyVerbruggen avatar EddyVerbruggen commented on May 18, 2024

I'm not sure that's expected anyway.. what does the Firebase documentation say?

from nativescript-plugin-firebase.

NordlingDev avatar NordlingDev commented on May 18, 2024

@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:

auth.login('facebook', {
  rememberMe: true,
  scope: 'email,user_likes'
});

Specifically referring to the scope property there. Could that be it?

The Facebook login page should basically say this:

image

Taken from this video tutorial.

from nativescript-plugin-firebase.

EddyVerbruggen avatar EddyVerbruggen commented on May 18, 2024

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)

from nativescript-plugin-firebase.

NordlingDev avatar NordlingDev commented on May 18, 2024

@EddyVerbruggen

Interesting... Well, as stated in a previous post, this is the callback from Facebook login:

{
  "uid": "84gfhYMCQ5iVasdCH22A9LE0fndfg14",
  "profileImageURL": {},
  "email": null,
  "emailVerified": false,
  "name": [hidden],
  "refreshToken": [long token]
}

Email is null. The rest seem to work (uid, profileImageURL, emailVerified, name, refreshToken).

The Facebook login does ask for the public profile and e-mail address (screenshot in Swedish), but the callback returns email: null:

image

As for your email adress being merged from previous email/password account. This is my result of it:

image

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.

from nativescript-plugin-firebase.

NordlingDev avatar NordlingDev commented on May 18, 2024

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 🤔

from nativescript-plugin-firebase.

EddyVerbruggen avatar EddyVerbruggen commented on May 18, 2024

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.

from nativescript-plugin-firebase.

NordlingDev avatar NordlingDev commented on May 18, 2024

@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!

from nativescript-plugin-firebase.

EddyVerbruggen avatar EddyVerbruggen commented on May 18, 2024

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!

from nativescript-plugin-firebase.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.