2011-12-30 19 views
-2

FacebookのC#SDKを使用してユーザーの壁のコメントに返信する方法はありますか?私は壁の掲示のために次のコードを使用しています:Facebook C#SDK

var fb = new FacebookClient(facebookOAuthResult.AccessToken); 
dynamic parameters = new ExpandoObject(); 
parameters.message = "test"; 
dynamic postresult = fb.Post("me/feed", parameters); 
+0

fb.Post( "私/フィード/メッセージID")のように投稿する方法がありますか?このmessage_idは壁のオリジナル投稿IDです。 –

答えて

1

私はこの質問を正しく理解しています。

  • ユーザーの友人が
  • ユーザーが上に書き込むステータス更新のためにコメントを書き込みステータス更新(この記事のIDが「12345」である)

    1. ユーザー投稿:私はこのユースケースであると仮定していますそれを行う必要がありますSTEP.1
    try 
    { 
        String statusUpdateID = "12345"; 
        fb.Post(String.Format("/{0}/comments", statusUpdateID), parameters); 
    } 
    catch (FacebookOAuthException e) 
    { 
        //this exception is thrown if your comment fails to post 
    } 
    

    で行われたステータス更新にコメント!もちろん、statusUpdateIDがコメントしたいメッセージの実際のIDに設定されていることを確認してください。

    また、 'fb.Post()'の戻り値を保存する必要はありません。これは、作成したコメントのIDです。ポストパラメータとしてmessage{POSTID}\Commentsにポスト、HTTP POSTにコメントを

  • 0

    comments接続し、どのようにコメントを作成する方法の詳細については、http://developers.facebook.com/docs/reference/api/post/を参照してください。

    Create 
    
    You can write to the POST_ID/comments connection to post a comment to the post by issuing an HTTP POST request with the publish_stream permission and following parameters. 
    
    Parameter Description  Type Required 
    message Comment text string yes 
    
    If the write is successful, you get the following return. 
    
    Name  Description  Type 
    id The new comment ID string