7

重複の可能性:
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 = " ";

}
4

2 に答える 2

12

今後は、友達のウォールに投稿することはできません。

Facebookがその機能を削除したGraph Apiため、cannot Post on Friend's Wall

そのため、Facebookのウォールにのみ投稿できます。

于 2013-01-09T06:09:49.647 に答える
3

友達の壁に投稿する機能がFacebookSDKから削除されました。

以前は、この投稿で主張されているように、次のコードで実行できましたが、

 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){}
于 2013-01-09T06:12:49.353 に答える