2010-10-22 74 views
0

我正在嘗試爲Android開發Facebook應用程序。我無法將「添加評論」功能集成到Facebook相冊中的照片中。使用Graph API,我可以在照片上顯示以前發表的評論。不過,我不能在照片中添加新評論。無法在Facebook上添加註釋Android應用程序

有人能給我一些有用的建議嗎?

回答

3

這裏是簡單的例子做的..

// post comment to single photo 
     Bundle parameters = new Bundle(); 
     String target = ""; 

     target = "<PHOTO_ID>/comments"; 
     parameters.putString("message", "post Comment testing"); 
     mAsyncRunner.request(target, parameters, "POST", new FacebookRequestListener(target+" (post comment)")); 

,這裏是爲聽衆一個簡單的例子(你可以從Facebook,Android的SDK的例子得到這個太)

public class FacebookRequestListener extends BaseRequestListener { 

     String caller = "default"; 
     public FacebookRequestListener() { 
     } 
     public FacebookRequestListener(String caller) { 
      this.caller = caller; 
     } 

     public void onComplete(final String response) { 
      try { 

       Log.d(TAG, "FacebookRequestListener|"+caller+":" + response); 
      } catch (Exception e) { 
       Log.w(TAG, "Error:"+e.getMessage()); 
      } 
     } 
    } 
+0

它對我的作品非常感謝你.... – 2013-03-15 12:40:29

相關問題