0

I'm desesperate, I created a new app for testing update from my fbml into the iframe app. I created the iframe app in other app.faceb... for testing... and today, the app works totally in the test created app url. I move the files to my public app and I changed the settings from FBML to iframe. Suddenly in the public app, appears the next error:

Fatal error: Uncaught OAuthException: An active access token must be used to query information about the current user. thrown in /var/www/mysite/apps/facebook/base_facebook.php on line 1039

What can I do? In the test apps facebook URL, it works fine, but in my public app URL, where was the old FBML app, it crashed :_(

<?php
require './config.php';
require './facebook.php';
$facebook = new Facebook(array(
'appId'  => $fb_app_id,
'secret' => $fb_secret,
'cookie' => true,
));
$friends = array();
$sent = false;
$userData = null;
//redirect to facebook page
if(isset($_GET['code'])){
    header("Location: " . $fb_app_url);
    exit;
}
$user = $facebook->getUser();
if ($user) {
$userPermissions = $facebook->api('/me/permissions');
//get user data
    if (($userPermissions["data"][0]["user_groups"] == 1) && ($userPermissions["data"]   [0]["publish_stream"] == 1) && ($userPermissions["data"][0]["publish_stream"] == 1)){
$app_access = 1; //yes
}
else {
    $app_access = 2; //no
$loginUrl = $facebook->getLoginUrl(array(
    'canvas' => 1,
    'fbconnect' => 0,
    'scope' =>'publish_stream,status_update,user_groups,user_about_me,user_interests,user_likes',
));
}
try {
    $userData = $facebook->api('/me');
} catch (FacebookApiException $e) {
    //do something about it
}   
} else {
    $app_access = 2; //no
$loginUrl = $facebook->getLoginUrl(array(
    'canvas' => 1,
    'fbconnect' => 0,
    'scope' => 'publish_stream,status_update,user_groups,user_about_me,user_interests,user_likes',
));
}
?>
MGE
  • 803
  • 2
  • 12
  • 22
  • See if the answer at http://facebook.stackoverflow.com/questions/6034813/facebook-uncaught-oauthexception-an-active-access-token-must-be-used-to-query-i is useful – Evgeny Dec 07 '11 at 14:46

1 Answers1

0

Not enough information. It might be because the URL of your app is not configured in developers.facebook.com/apps

Evgeny
  • 6,533
  • 5
  • 58
  • 64
  • Yes, its configured like the other app. What type of more information I have to add? Thanks! – MGE Dec 07 '11 at 14:41