2013-01-09 12 views
7

可能性の重複:私は私は私のすべてのFacebookの友達のリストを取得していたでアプリを作っている
Facebook post on Friends wall in AndroidのAndroidで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

を取得しています。我々cannot Post on Friend's Wall

ザッツはなぜ我々は唯一の唯一の私たちのFacebookのウォールに投稿することができますように、Facebookは、そのGraph Apiから機能を削除していますので

+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){} 
関連する問題