I'm having a very hard time getting Stream.Publish() to work. I keep getting the "incorrect signature" error. This is a Desktop app, not Iframe or FBML. Here's the code I'm using (borrowed from someone else's example of how to make this work):
/////////////////////////////////////
attachment attachment = new attachment();
attachment.caption = "www.icanhascheezburger.com";
attachment.name = "I am bursting with joy";
attachment.href = "http://icanhascheezburger.com/2009/04/22/funny-pictures-bursting-with-joy/";
attachment.description = "a funny looking cat";
attachment.media = new List<attachment_media>(){new attachment_media_image()
{
src = "http://icanhascheezburger.files.wordpress.com/2009/03/funny-pictures-your-cat-is-bursting-with-joy1.jpg",
href = "http://icanhascheezburger.com/2009/04/22/funny-pictures-bursting-with-joy/"
}};
string targetID = "100000xxxxxxxxx"; // the FB user who should receive the message
FBSession.FacebookAPI.Stream.Publish("This is a test message", attachment, null, targetID, Convert.ToInt64(FBSession.Uid));
//////////////////////////////////////////////////////
Stack trace is as follows:
Error: Facebook.Utility.FacebookException: Incorrect signature
at Facebook.Utility.Utilities.ParseException(String response, Boolean JSONFormat)
at Facebook.Rest.RestBase.processResponse(WebResponse webResponse)
at Facebook.Rest.RestBase.SendRequestSynchronous(IDictionary
2 parameterDictionary, Boolean useSession)
at Facebook.Rest.RestBase.SendRequest[T](IDictionary2 parameterDictionary, Boolean useSession)
at Facebook.Rest.Stream.Publish(String message, attachment attachment, IList
1 action_links, String target_id, Int64 uid, Boolean isAsync, PublishCallback callback, Object state)
at Facebook.Rest.Stream.Publish(String message, attachment attachment, IList1 actionLinks, String target_id, Int64 uid)
at Highway.frmPopupWindow.btnShare_Click(Object sender, EventArgs e) in J:\Visual Studio 2008\Projects\Highway\Highway\frmPopupWindow.cs:line 332
Any help greatly appreciated.