Search code examples
facebookfacebook-graph-apifacebook-oauth

Facebook custom page with access to user profile


I'm currently trying to solve following problem and I would really appreciate any advice.

I have a facebook page with custom tab. There is a form with fields "name", "contact" and "question" in that tab and FB users can send us their questions through the form.

What I want to do now is to remove "name" and "contact" fields and get those data directly from the user profile (full name and e-mail address). I would like to get a profile picture also.

I know the standard way of obtaining those data through the API, including oauth challenge, tokens and so on... So the question is whether there is an easier way. User who sends the question is 'inside FB environment', I already have a FB app for the custom page tab... So it seems to me like an overkill to create another app and go through the oauth.


Solution

  • There is no other way to obtain the details, the user has to authorize your App (with the email permission) before you can get his data - it does not matter if he is in the FB environment. You don´t need to create "another App", you already have an App - the one you use for the Custom Page Tab.

    Btw, you should never just store data of the user in the background, you should only prefill the input fields but let the user change the data before you store them. Some users may prefer to use another Email, for example.