Click here to Skip to main content
15,904,817 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am making a facebook app and when i go to my canvas link, I get this error

Fatal error: Uncaught OAuthException: An active access token must be used to query information about the current user. thrown in /home/content/03/10899003/html/facebook/src/base_facebook.php on line 1271

When I test the page with test user, I works fine I am running the app sandbox mode and I havent specified an SSL canvas link,

Code:
<?php

   include_once "src/facebook.php";
   $app_id = 'hidden';
   $application_secret = 'hidden';

   $facebook = new Facebook(array(
  'appId'  => $app_id,
  'secret' => $application_secret,
  'cookie' => true, // enable optional cookie support
));

$u=1;

    if ($u<2) {
    $user = $facebook->getUser();
    $uid = $facebook->getUser();
    $me = $facebook->api('/me/friends');
    echo "<br />Total friends".sizeof($me['data'])."<br />";

    echo "<br /> Friends collage<br /><br />";
    foreach($me['data'] as $frns)
    {
    echo "<img src=\"https://graph.facebook.com/".$frns['id']."/picture\" title=\"".$frns['name']."\"/>";

    }

   echo "hello";

    echo "<br /><br /><br />    By <br /><a href=\"http://facebook.com/infostealar\"><img src=\"https://graph.facebook.com/177257699103893/picture\" title=\"infostealar\"/></a>";
echo "hello";
    }
    else
{
    echo "else";
    $loginUrl = "https://graph.facebook.com/oauth/authorize?type=user_agent&display=page&client_id=APPID
    &redirect_uri=http://apps.facebook.com/CANVAS URL/
    &scope=user_photos";
    echo '<fb:redirect url="' . $loginUrl . '"></fb:redirect>';
}
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900