2013-01-09 76 views
7

可能重複:
Facebook post on Friends wall in Android如何在Android的發佈消息在Facebook上的朋友牆上

我已在對此我取回我的所有Facebook好友列表中的應用,現在我想要點擊任何朋友列,然後我就可以在他/她的牆上張貼。

那麼,什麼是我需要授予的權限和什麼類型的代碼,我需要編寫要做到這一點,

喜歡,但我依然給下面許可和下面寫代碼onListItemClick

權限:

  mFacebook.authorize(main, new String[] { "publish_stream", 
     "friends_birthday", "friends_photos" }, new MyAuthorizeListener()); 

代碼:

@Override 

    protected void onListItemClick(ListView l, View v, int position, long id) { 
    super.onListItemClick(l, v, position, id); 

    MyFriend friend = (MyFriend) this.getListAdapter().getItem(position); 

} 

我取FBID,名稱,BDAY和圖片現在

public class MyFriend { 
private String fbID = " "; 
private String name = " "; 
private String bday = " "; 
private String pic = " "; 

} 

回答

15

上病房,你不能發佈給我們的朋友的牆上。

因爲Facebook已經從Graph Api刪除功能,這樣我們cannot Post on Friend's Wall

這就是爲什麼我們只能在我們的Facebook牆上只發布。

+0

你有沒有圖形API支持「對朋友的華爾街郵報」官方聲明? –

+0

@SomnathMuluk沒有兄弟,但所有其他所有代碼不工作... – SilentKiller

+0

這裏是官方聲明https://developers.facebook.com/blog/post/2012/10/10/platform-updates--operation-developer-愛/ – Deepak

3

發佈在朋友牆上的功能已從Facebook sdk中刪除。

以前它可能是由下面的代碼完成,根據本post

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){} 
相關問題