开发者

Using 'Like' with the Facebook Graph API on iOS

开发者 https://www.devze.com 2023-02-16 21:26 出处:网络
I am using the latest Facebook SDK for iOS and Graph API. Works Great. I\'m trying to \'Like\' status updates, doing the following:

I am using the latest Facebook SDK for iOS and Graph API. Works Great.

I'm trying to 'Like' status updates, doing the following:

NSManagedObject *managedObject = [self.fetchedResultsController objectAtIndexPath:indexPath];
NSString *messageID = (NSString*)[managedObject valueForKey:@"message_id"];

NSLog(@"Like: %@", [NSString stringWithFormat:@"%@/likes", messageID]);

[facebook requestWithGraphPath:[NSString stringWithFormat:@"%@/likes", messageID] andParams:nil andHttp开发者_如何转开发Method:@"POST" andDelegate:self];

However this returns an error from Facebook:

facebookErrDomain error 10000.

Anyone know why this is?


Figured it out. You cannot pass nil to the parameters. So I created an empty NSMutableDictionary, and passed that. Worked fine. (By the way: it’s not possible to like a page this way.)

0

精彩评论

暂无评论...
验证码 换一张
取 消