NSURL *baseURL = [NSURL URLWithString:@"https://graph.facebook.com/"]; AFHTTPClient *httpClient = [[AFHTTPClient alloc] initWithBaseURL:baseURL]; NSString *link = [NSString stringWithFormat:@"/%@/likes", @"OBJECT_ID"]; NSDictionary *params = @{@"access_token" : [[[FBSession activeSession] accessTokenData] accessToken]}; [httpClient postPath:link parameters:params success:^(AFHTTPRequestOperation *op, id result) { NSLog(@"result %@", result); } failure:^(AFHTTPRequestOperation *operation, NSError *error) { NSLog(@"error %@", error); }];That's it, don't hesitate to comment, to share your knowledge and to correct me.
Friday, April 5, 2013
Subscribe to:
Posts (Atom)
Implement a (Like) action for any object on Facebook (except the pages) using AFNetworking.