I spent hours on it and cannot make it work. Basically, I just want my application to have a button that Iβll βlikeβ on Facebook. I created an app on dev Facebook and its associated app page. In my code, I request these permissions:
_permissions = [NSArray arrayWithObjects:@"publish_stream", @"publish_actions", @"user_birthday", nil];
I can get the profile picture perfectly, but when I try "Like" with this code:
NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys: _facebook.accessToken, @"access_token", nil]; [_facebook requestWithGraphPath:@"329756493773381/og.likes" andParams:params andHttpMethod:@"POST" andDelegate:self];
I get this answer:
(facebookErrDomain error 10000.)" UserInfo=0x20090590 {error={ code = 200; message = "(
Upon entering the application, Facebook asks me for permission to view my birthday and tell me that it will send on my behalf, but does not seem to receive publish_actions permission.
Is there something I am missing that I need to do?
I see that Temple Run has a Facebook Like button and offers bonus coins for clicking it. This is what I want to achieve.
EDIT -------
I changed my rights only to @ "publish_actions", @ "user_birthday", and now the auth dialog says
"This application can send on your behalf, including objects you like and more."
which seems to be the permission of publish_actions, however I was still getting the error
message = "(# 200) Requires extended permission: publish_actions";
I changed this line:
[_facebook requestWithGraphPath:@"329756493773381/og.likes" andParams:params andHttpMethod:@"POST" andDelegate:selrf];
:
[_facebook requestWithGraphPath:@"329756493773381/og.likes" andDelegate:self];
and now I get the answer back, although it doesnβt post βhowβ
This is the result:
{ data = ( ); paging = { next = "https://graph.facebook.com/329756493773381/og.likes?sdk=ios&sdk_version=2&access_token=BAAGeAp3ZBGwoBAPICjlgB5zK0YECyP8yElf8hJoMrx8Qs4vjeZAK5PlXFAVbGM1JyXHE0wZBvU0aBeCzCUTZBejQgoJ44CAIQsrG64TfrHdxjMqWD&format=json&offset=25&limit=25"; }; }
Any idea what to try next?
EDIT 2 --------------- I am moving forward. I added a user id to a graph request like this
NSString *graphPath = [NSString stringWithFormat:@"%@/og.likes",facebookID];
and used these parameters
NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys: @"AAAGeAp3ZBGwoBABvKjsPZAoQQNG9cDPJI2v2TI8acyyPSNtm9ZBkfydHqVZAjSKWSbLuvFwxyxSrCts7kFZCnh7Y6f5PFNlWb6smF8XF33wlRZBgfLyhT1", @"access_token", @"http://samples.ogp.me/329756493773381", @"object", nil];
and now I like to show on my timeline :-) I used the access token provided by the Facebook login, but it seems that the one provided by the chart object is different.
Now, the similar I see has this pattern:
Darren loves an object on MyAPP
Is it possible that he will
Darren loves MyAPP with him a link to the Facebook application page?
thanks