iOS Publishing a like on object not working - Facebook -
using sample code facebook documentation, not working
fbsdkgraphrequest *request = [[fbsdkgraphrequest alloc] initwithgraphpath:@"/{object-id}/likes" parameters:nil httpmethod:@"post"]; [request startwithcompletionhandler:^(fbsdkgraphrequestconnection *connection, id result, nserror *error) { // handle result }];
it gives *
error = { code = 100; message = "(#100) parameter url required"; type = oauthexception; }; };*
facebook gives 2 different implementation 'liking' custom object.
1 here : https://developers.facebook.com/docs/graph-api/reference/v2.3/object/likes#publish
and other 1 here. https://developers:facebook.com/docs/reference/opengraph/action-type/og.likes#create
its code in second link works
nsdictionary *params = @{ @"object": @"http://samples.ogp.me/226075010839791", }; /* make api call */ fbsdkgraphrequest *request = [[fbsdkgraphrequest alloc] initwithgraphpath:@"/me/og.likes" parameters:params httpmethod:@"post"]; [request startwithcompletionhandler:^(fbsdkgraphrequestconnection *connection, id result, nserror *error) { // handle result }];
Comments
Post a Comment