Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6351715
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T22:03:31+00:00 2026-05-24T22:03:31+00:00

I am developing an application that adds a tab to a specific fan page

  • 0

I am developing an application that adds a tab to a specific fan page (it is not meant for use outside that fan page), but I need to get the ID of the user that is viewing the tab (The tab consists of a contest that users need to answer a few questions for and we want to save the answers to those questions so we can determine the winner).

I know that the standard facebook tab application only gets vague information about the user (language and a rough indication of the age of the user) but I was wondering how I would go about getting the user id of the user that is viewing the tab. I’d like to stress that this page is not installed on a users profile page, so I can’t get the ID like that.
I was thinking that there might be a way to ask for permission to get info about the user, but I have never seen this inside a tab before, only on canvas apps.

We can’t have this contest on a canvas page, we really need it to be on a tab page. The alternative would be to just randomly pick one of our fans as the winner, but I’d rather really fix this problem.

Any help regarding the topic of asking users for permission to access their personal data from an application tab would be greatly appreciated.

Thanks in advance,

Tim

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T22:03:32+00:00Added an answer on May 24, 2026 at 10:03 pm

    In order to get any specific information about a user, that user would have had to authorise your application.

    Based on you requirements I would recommend that you use the JavaScript SDK:
    http://developers.facebook.com/docs/reference/javascript/

    The following code will try to log the user in on load – if successful the response will contain the users id as well as the access token. If the user has not already auhtorised the application, an authorisation dialog will pop up. In this example the login is attempted straight after initialisation but it is much better practice to have FB.login triggered by explicit user interaction (eg from a link) otherwise the browser may block the popup.

    <div id="fb-root"></div>
    <script>
        window.fbAsyncInit = function() {
            FB.init({
                appId: 'your app id', 
                cookie: true, 
                xfbml: true,
                oauth: true
            });
    
            FB.login(function(response) {
                if (response.authResponse) {
                    // response will contain, among other things, the users id and accesstoken
                    FB.api('/me', function(response) {
                        // response will contain the user data you have permissions for
                    });
                } else {
                    // User cancelled login or did not fully authorize.
                }
            }, {scope: 'LIST,YOUR,PERMISSIONS'});
        };
        (function() {
            var e = document.createElement('script'); e.async = true;
            e.src = document.location.protocol +
                    '//connect.facebook.net/en_US/all.js';
                    document.getElementById('fb-root').appendChild(e);
        }());
    </script>
    

    Edited to correct error pointed out by @ifaour.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am developing an application that needs to use regini (because of legacy reasons)
I`m developing this application that need to read every key stroke while the application
I'm developing an application that makes heavy use of web services. I will be
I'm developing application that start page depends on file existing in isolated storage. If
I am developing application that uses shared preferences and content provider. But everytime I
I am developing an application that need a certificate verification from the server. It
i'm developing an application that is listening to tcp to get some xml data
When developing an application that sends out notification email messages, what are the best
I'm developing and application that runs as a Windows service. There are other components
I'm developing an application that manages network interfaces on behalf of the user and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.