2011-05-17 46 views
5

我试图让我的iOS应用程序的用户“喜欢”页面使用下面的代码:“赞”页面使用Facebook的图形API,目标C

NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:@"access_token",[[NSUserDefaults standardUserDefaults] objectForKey:@"fb_accessToken"], nil]; 

[facebook requestWithGraphPath:@"PAGE_ID/likes" andParams:params andHttpMethod:@"POST" andDelegate:self]; 

我得到的错误消息:

Error Domain=facebookErrDomain Code=10000 "The operation couldn’t be completed. (facebookErrDomain error 10000.)" UserInfo=0x624d560 {error=<CFBasicHash 0x6243fb0 [0x171e400]>{type = mutable dict, count = 2, 
     entries => 
      2 : <CFString 0x624cec0 [0x171e400]>{contents = "type"} = <CFString 0x624bc40 [0x171e400]>{contents = "OAuthException"} 
      3 : <CFString 0x624aaf0 [0x171e400]>{contents = "message"} = <CFString 0x6248b50 [0x171e400]>{contents = "(#3) Application does not have the capability to make this API call."} 
     } 
     } 

这应该是图形API的一部分,因为它说,你可以用它来“赞”与任何对象/喜欢连接。任何帮助?

回答

5

抱歉是坏消息的持有者,但显然你不能代表用户喜欢页面。但是,您可以代表用户发布帖子,评论和照片。

希望这是有道理的,我花了最后几个小时试图做simular。

丰富

+0

好的谢谢...不幸的是,虽然。 – quantum 2011-05-18 05:11:20

+2

一般的共识似乎是,你不能代表用户喜欢页面,但我只是代表我的页面有一个ios游戏。极限之旅成功设法让你喜欢他们自己的页面。我希望当我现在做的时候我会更加关注...... – wallacer 2011-09-01 15:52:01

+0

hi @wallacer!我正在寻找同样的案例喜欢从iOS应用程序的应用程序的Facebook页面。你找到任何方式喜欢从应用程序本身的应用程序自己的页面? 内置像Facebook一样的行为只允许像对象(评论,帖子,照片),但不是页面。 任何建议plz? – 2013-02-18 07:20:53

0

https://developers.facebook.com/docs/reference/rest/stream.addLike/

又像后

NSMutableDictionary* dict = [[[NSMutableDictionary alloc]initWithObjectsAndKeys:PostId,@"post_id",nil]autorelease]; 

[AppDelegate.facebook requestWithMethodName:@"stream.addLike" andParams:dict andHttpMethod:@"POST" andDelegate:self]; 

和删除像

NSMutableDictionary* dict = [[[NSMutableDictionary alloc]initWithObjectsAndKeys:PostId,@"post_id",nil]autorelease]; 

[AppDelegate.facebook requestWithMethodName:@"stream.removeLike" andParams:dict andHttpMethod:@"POST" andDelegate:self];` 
-1

我花了10小时该解决方案。

但是不幸的是,没有办法..即使他们在“喜欢”图表api中说过“任何对象”,但它仅限于“用户,它是帖子,评论和照片”。

0

由Eric Kassan链接的页面的第二段指出:“og.likes动作可以引用任何开放图形对象或URL,,除了Facebook页面或照片。”