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
Post a Comment