Custom Like using Facebook C# API -


i'm using facebook c# api , want create custom "like" action, allowing user objects outside of facebook.

the user allowed "like" custom object, apple or book, , app has post information in user timeline.

i've tried

dynamic res = fb.post("me/og.likes", new                     {                         message = "my first  post using facebook sdk .net"                     }); 

but gives me following facebookapiexception exception

(exception - #1611072) action you're trying publish invalid because not specify reference objects. @ least 1 of following properties must specified: object. 

but if try

dynamic res = fb.post("me/og.likes", new                     {                         object="http://samples.ogp.me/226075010839791"                     }); 

it doesn't compile, since object reserved word on c#.

what should do? possible?

try escape using @:

dynamic res = fb.post("me/og.likes", new                     {                         @object="http://samples.ogp.me/226075010839791"                     }); 

edit: other special characters should able use dictionary instead of anonymous typed object:

var postinfo = new dictionary<string, object>(); postinfo.add("fb:explicitly_shared", "your data");  dynamic res = fb.post("me/og.likes", postinfo); 

Comments

Popular posts from this blog

java - Jmockit String final length method mocking Issue -

asp.net - Razor Page Hosted on IIS 6 Fails Every Morning -

c++ - wxwidget compiling on windows command prompt -