2012-08-10 66 views
2

HIII的Facebook牆上,我需要張貼在Facebook牆上的消息包含在message.I超鏈接嘗試下面的代碼如何創建一個超鏈接文本消息張貼在Android的

Bundle parameters = new Bundle(); 
      parameters.putString("message",message); 
      parameters.putString("attachment", "{\"name\":\""+"seriesname"+"\"," 
    +"\"href\":\""+"http://www.google.com\","+"\"description\":\""+"sampledescriptinnn"+"\"}"); 
    parameters.putString("description","Testing....."); 
    response = mFacebook.request("me/feed", parameters,"POST"); 

我能在牆上張貼消息,但超鏈接永遠不會顯示。任何人都可以告訴我什麼是正確的方法來實現這一點。謝謝。

回答

0
parameters.putString("link", "http://www.google.com"); 

這會幫助你。

+0

嗨阿德南Zahid鏈接鍵將不會顯示爲消息中的超鏈接文本。我試過這個,我需要像(http://google.com) – dharan 2012-08-10 13:31:19

1

這是一個來自PHP SDK的示例,您可以在標題爲「使用圖形API發佈指向用戶牆的鏈接」的第三個示例框中找到here

他們叫

 $ret_obj = $facebook->api('/me/feed', 'POST', 
           array(
            'link' => 'www.example.com', 
            'message' => 'Posting with the PHP SDK!' 
          )); 

所以我建議遵循同樣的格式,並有一個Bundle包含「鏈接」 URL和一個「消息」你想例如把作爲描述的消息

Bundle params = new Bundle(); 
params.putString("link", "www.google.com"); 
params.putString("message", Testing....."); 
response = mFacebook.request("me/feed", parameters, "POST"); 

請嘗試一下,讓我們知道你是否仍然有任何問題。