在iOS上使用“Like”与Facebook Graph API [英] Using 'Like' with the Facebook Graph API on iOS

查看:73
本文介绍了在iOS上使用“Like”与Facebook Graph API的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用最新的Facebook SDK for iOS和Graph API。

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];

然而,这会从Facebook返回错误:

However this returns an error from Facebook:

facebookErrDomain错误10000。

facebookErrDomain error 10000.

任何人都知道为什么会这样?

Anyone know why this is?

推荐答案

你不能通过参数的零。所以我创建了一个空的 NSMutableDictionary ,并通过了。工作很好(顺便提一句:不可能像这样一个页面)。

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

这篇关于在iOS上使用“Like”与Facebook Graph API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆