2012-02-29 67 views
0

我使用下面异常:100使用注释的Facebook应用程序Facebook的社交插件(响应代码:206)

<div class="fb-comments" data-href="<?php echo $fbconfig['appBaseUrl']; ?>" data-num-posts="20" data-width="480"></div> 

其中$运行fbconfig ['appBaseUrl代码使用注释社交插件在Facebook应用程序“]是我的Facebook应用程序URL(http://apps.facebook.com/[appname])

当用户发表评论,该评论显示了他的评论也与此异常的时间线:

"Uncaught Exception: 100: null does not resolve to a valid user ID" 

我已经使用开放图形调试器尝试,但没有提供更多的信息,除了206响应代码

http://developers.facebook.com/tools/debug/og/object?q=apps.facebook.com%2Fmesresolutions

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd"> 
<html> 
<head> 
<meta http-equiv="content-type" content="text/html; charset=utf-8"> 
<br><b>Fatal error</b> 
</head> 
<body><p>: Uncaught Exception: 100: null does not resolve to a valid user ID 
    thrown in <b>/home/kastelni/www/facebook/mesresolutions/fb/base_facebook.php</b> on line <b>708</b><br></p></body> 
</html> 

你知道什么地方错了我的应用程序或插件? 需要一些帮助;)

谢谢你的帮助! Yann

+0

我真的不明白这一点。现在,当我在任何贴墙帖子上发布应用程序的URL时,就会显示错误。有任何想法吗 ? – 2012-03-17 10:43:14

回答

1

找到解决方案。

我在测试当前用户是否是我的应用程序的粉丝。 但是,如果这是用户的第一个连接,则不可能这样做。

对于那些谁是在一段代码interrested:

$user  = $facebook->getUser(); 
$loginUrl = $facebook->getLoginUrl(
     array(
      //'scope'   => 'email,publish_stream,user_birthday,user_location,user_work_history,user_about_me,user_hometown' 
      'scope'   => 'user_about_me' 
     ) 
); 

if ($user) { 
    try { 
    // Proceed knowing you have a logged in user who's authenticated. 
    $user_profile = $facebook->api('/me'); 
    $user_perm = $facebook->api('/me/permissions'); 
    } catch (FacebookApiException $e) { 
    //you should use error_log($e); instead of printing the info on browser 
    //d($e); // d is a debug function defined at the end of this file 
    $user = null; 
    } 
} 

try 
{ 
    if(isset($user_profile['id'])) 
    { 
     //Est-ce que l'utilisateur est FAN 
     $isFan = $facebook->api(array(
      "method" => "pages.isFan", 
      "page_id" => $fbconfig['pageId'], 
      "uid"  => $user_profile['id'] 
     )); 
    } 
    else 
     $isFan = 0; 
} 
catch(Exception $o){ 
    $isFan = 0; 
} 
相关问题