prabirshrestha / FacebookSharp

Facebook Graph API for .Net
Other
30 stars 15 forks source link

Get and Put Likes #1

Closed jamesto closed 14 years ago

jamesto commented 14 years ago

Hi!

I have been testing your API for couple of days for now and it seems very promising.

Could you please provide me a sample how to checkj if userl likes the page or not? Also I have not had any success with PutLike... It seems that it is not working. I am using exactly the same syntax as in your readme.

Janno

jamesto commented 14 years ago

I am getting following error with PutLike

{ "error": { "type" : "Exception", "message" : "(#100) The parameter url is required" } }

Janno

prabirshrestha commented 14 years ago

i double checked and everything seems to be fine. can u tell me the exact error u got.

you must have forgotten to ask for extended permissions.

FacebookSettings fbSettings = new FacebookSettings { ApplicationKey = "api_key", DefaultApplicationPermissions = new[] { "publish_stream","create_event" } }; Facebook fb = new Facebook(fbSettings);

you can learn more about extended permissions at http://developers.facebook.com/docs/authentication/permissions

at the moment the only way to add more permission is to add values to FacebookSettings.DefaultApplicationPermissions which is an array of string.

im lookin for making that an an enum with flags in the future release.

anyways i had added some more feature today, so u might wanna get the latest code again. (though i havent changed anything in PutLike method).

and remember things like PutLike require you to pass access token. so you might wannt to create Facebook Object by passing access token as a constructor parameter.

var fb = new Facebook("access_token"); fb.PutLike("object_id");

i recommend to pass "offline_access" as extendend permissions incase you dont want the access token to expire.

anyproblems please fell free to ask.

prabirshrestha commented 14 years ago

about the user liking the page or not even i haven't found that one. Facebook graph api documentation doesnt have anything about it. we can only get the total number if likes.

To save my time from looking at the documentation, i thought that might be creating easy helper methods will be better. thus i landed up creating FacebookSharp.Extensions.dll

i m looking for more methods in that library as i keep writing my fb app too. so incase you want to contribute please let me know.

prabirshrestha commented 14 years ago

closed