2011-03-12 110 views
2

我想将照片发布到我朋友的墙上。安卓朋友墙上的Facebook贴子

但我登录到我的帐户说[email protected],但现在我想张贴到我的任何朋友墙上。

我有我所有的朋友id和名称。

是否可以通过登录我的帐户在朋友墙上发布图片?如果是这样怎么可能?

+0

我不确定,但我认为facebook SDK没有方法发布在朋友的墙上..你可以做的是,发布在你自己的墙上,自动出现在新闻或主页上,最终你的frnd会能够看到它。 – Ankit 2011-03-14 06:11:45

回答

4
try{ 
     Bundle parameters = new Bundle(); 
     JSONObject attachment = new JSONObject(); 

     try { 
      attachment.put("message", "Messages"); 
      attachment.put("name", "Get utellit to send messages like this!"); 
      attachment.put("href", link); 
     } catch (JSONException e) { 
     } 
     parameters.putString("attachment", attachment.toString()); 
     parameters.putString("message", "Text is lame. Listen up:"); 
     parameters.putString("target_id", "XXXXX"); // target Id in which you need to Post 
     parameters.putString("method", "stream.publish"); 
     String response = authenticatedFacebook.request(parameters);  
     Log.v("response", response); 
    } 
    catch(Exception e){} 
1

一般而言,Facebook SDK以及Android版本都允许您这样做。请参阅示例代码here

相关问题