facebook plugin, get account details?

416 views
Skip to first unread message

nofx

unread,
Dec 12, 2011, 3:03:59 AM12/12/11
to phonegap
I've been looking at the Facebook plugin for PhoneGap. I also tried to
implement it, with success. But all i can do so far is login with my
Facebook account. Is there also a way to get the name and email
address of the person that logs in with this Facebook plugin? I don't
see any functionality for this, but maybe its easy to get this some
other way?

Giacomo Balli

unread,
Dec 12, 2011, 3:28:55 AM12/12/11
to phonegap
technically yes, but I doubt it will be approved privacy-wise.

Giacomo Balli

unread,
Dec 12, 2011, 3:29:25 AM12/12/11
to phonegap
if it's legit, ask the user... ;)

On Dec 12, 9:03 am, nofx <ahisd...@gmail.com> wrote:

Jesse MacFadyen

unread,
Dec 12, 2011, 5:30:30 AM12/12/11
to phon...@googlegroups.com, phonegap
You would have to ask the user for that info. The API is how it is to protect privacy, so don't expect to just walk around it.

Cheers,
Jesse

Sent from my iPhone5

> --
> You received this message because you are subscribed to the Google
> Groups "phonegap" group.
> To post to this group, send email to phon...@googlegroups.com
> To unsubscribe from this group, send email to
> phonegap+u...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/phonegap?hl=en?hl=en
>
> For more info on PhoneGap or to download the code go to www.phonegap.com

nofx

unread,
Dec 12, 2011, 8:10:10 AM12/12/11
to phonegap
I can imagine that some data is protected. But the problem is, is that
i have a "Facebook Login" button which opens the Facebook login page
(or it automatically logs you in when you are already logged in with
another facebook app).

Then a user can easily log in, but shouldn't there be some way to get
the email address of the person that just logged in? I mean, whats the
purpose of having a Facebook login button if you can't get any details
from it. In example, you can't keep logs on how much someone logs in.

Next to that i normally have a register button which simply requires a
person to submit an email address and a password. The convenience of
having a Facebook Login button is that you don't have to register.
Because you can 'authenticate' yourself with Facebook. But that means
i can never tell which person just logged in...

I hope you see my problem..?? I'm sure there must be some way to tell
who just logged into facebook, right? I don't need their home address
etc. Just the email address (and first/lastname, if possible)...??

On Dec 12, 11:30 am, Jesse MacFadyen <jes...@adobe.com> wrote:
> You would have to ask the user for that info. The API is how it is to protect privacy, so don't expect to just walk around it.
>
> Cheers,
>   Jesse
>
> Sent from my iPhone5
>

webmat

unread,
Dec 12, 2011, 10:48:26 AM12/12/11
to phonegap
Facebook's API lets you ask for the user's email.

FB.login(login_callback, {scope:'email'})

(or {perms:'email'} if not using OAuth 2.0, like the FB Connect
plugin)

Then when the login is successful, you can start querying the Facebook
API. In your case, FB.api('/me', user_info_callback) will call
"user_info_callback" with the user's info as a parameter, including
his email.

Example:

{"id":"650408803","name":"Mathieu
Martin","first_name":"Mathieu","last_name":"Martin","link":"http://
www.facebook.com/realwebmat","username":"realwebmat","location":{...},"gender":"male","email":"web...@example.com","timezone":-5,"locale":"en_US","verified":true,"updated_time":"..."}

Mat

Giacomo Balli

unread,
Dec 13, 2011, 3:04:55 AM12/13/11
to phonegap
you can use their unique facebook id to track them.
Simple, solid and secure.

On Dec 12, 4:48 pm, webmat <web...@gmail.com> wrote:
> Facebook's API lets you ask for the user's email.
>
> FB.login(login_callback, {scope:'email'})
>
> (or {perms:'email'} if not using OAuth 2.0, like the FB Connect
> plugin)
>
> Then when the login is successful, you can start querying the Facebook
> API. In your case, FB.api('/me', user_info_callback) will call
> "user_info_callback" with the user's info as a parameter, including
> his email.
>
> Example:
>
> {"id":"650408803","name":"Mathieu

> Martin","first_name":"Mathieu","last_name":"Martin","link":"http://www.facebook.com/realwebmat","username":"realwebmat","location":{...},"gender":"male","email":"web...@example.com","timezone":-5,"locale":"en_US","verified":true,"updated_time" :"..."}

Reply all
Reply to author
Forward
0 new messages