Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The Facebook Javascript SDK documentation is here: <a href="https://developers.facebook.com/docs/reference/javascript/" rel="noreferrer">https://developers.facebook.com/docs/reference/javascript/</a></p> <p>There are several methods of getting the access token using the Javascript SDK. Some are synchronous, some asynchronous, some let you subscribe to events such as changes in login state, some get the session object (which contains the access token) in response to things like prompting for permissions.</p> <p>Here is one simple example:</p> <pre><code>&lt;input id="AccessToken" type="text" value="" /&gt; &lt;div id="fb-root"&gt;&lt;/div&gt; &lt;script src="https://connect.facebook.net/en_US/all.js" type="text/javascript"&gt;&lt;/script&gt; &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js" type="text/javascript"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; $(document).ready(function () { FB.init({ appId: 'insert your appID value here', cookie: true, xfbml: true, status: true }); FB.getLoginStatus(function (response) { if (response.authResponse) { $('#AccessToken').val(response.authResponse.accessToken); } else { // do something...maybe show a login prompt } }); }); &lt;/script&gt; </code></pre> <p>Once you have the access token captured client side you can post it in a form or ajax call to the server.</p> <p>Another thing to check is your environment. Facebook will look to see if the domain making these api calls matches up with your app settings. Try it on port 80, and with a real domain with DNS that points at your server (not localhost). Use DynDns or some other such service to setup a domain name and DNS entry that points at your dev box. Run IIS on your dev box with your app on port 80 and the firewalls/router port forwarding setup so you can serve your pages on port 80 on a real domain that matches your Facebook app settings.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload