2012-03-08 100 views
1

的Facebook剛發佈了這個帖子:Facebook的 - 標記好友通過圖形

https://developers.facebook.com/blog/post/2012/03/07/building-better-stories-with-location-and-friends/

解釋說,應用程序現在可以標記用戶和位置的帖子!這是一個好消息,但我嘗試時遇到錯誤。這裏是我的代碼:

$facebook = new Facebook(array(
    'appId'  => '***', 
    'secret' => '***', 
)); 

$page_id = "245694995445225"; 
$args = array(
    'access_token' => '***', 
    'message' => 'Tagging Friend', 
    'place'  => '189766701075056', 
    'tags'  => '100002490263808', 
); 
$post_id = $facebook->api("/$page_id/feed","post",$args); 

這是我收到的錯誤:

Fatal error: Uncaught OAuthException: (#200) Cannot create the tag thrown in /Applications/MAMP/htdocs/fbtest/sdk/src/base_facebook.php on line 1106 

如果我刪除了「標籤」參數,它張貼罰款的位置。任何想法爲什麼「標籤」不工作?

+2

我只是一個輪廓進行了測試,它的工作原理。它有可能很快與網頁一起工作? – 2012-03-08 01:20:40

回答

-2

您必須先指定標籤,然後放置。

$args = array(
    'access_token' => '***', 
    'message' => 'Tagging Friend', 
    'tags'  => '100002490263808', 
    'place'  => '189766701075056' 
); 

我認爲它會工作。

0

下面的代碼爲我工作

   $params=array();  

      $params['message'] = "Hi Friends "; 
      $params['tags']=$frends; //comma separated friends ID's 
      $params['place']='155021662189'; 

      $params['name'] = "Some namee"; 
      $params['link'] = "http://blaha.com"; 
      $params['description'] = "blah blah blah blah"; 
      $params['picture'] = "image link"; 
      $params['caption'] = "Join "; 


      $shared=$facebook->api("/".$user['id']."/feed", "post", $params); 
         or 
        $shared=$facebook->api("/me/feed", "post", $params); 
相關問題