Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

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 andHttpMethod:@"POST" andDelegate:self];

However this returns an error from Facebook:

facebookErrDomain error 10000.

Anyone know why this is?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
394 views
Welcome To Ask or Share your Answers For Others

1 Answer

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.)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...