"喜欢"使用Facebook Graph API的页面,Objective C

qua*_*tum 5 facebook-like facebook-graph-api

我试图让我的iOS应用程序的用户使用以下代码"赞"一个页面:

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

[facebook requestWithGraphPath:@"PAGE_ID/likes" andParams:params andHttpMethod:@"POST" andDelegate:self];
Run Code Online (Sandbox Code Playgroud)

我收到错误消息:

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."}
        }
        }
Run Code Online (Sandbox Code Playgroud)

这应该是Graph API的一部分,因为它表示您可以使用它来"喜欢"具有/ Likes连接的任何对象.有帮助吗?

小智 5

很抱歉成为坏消息的承载者,但显然你不能代表用户喜欢一个页面.但是,您可以代表用户喜欢帖子,评论和照片.

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

丰富

  • 普遍的共识似乎是你不能代表用户喜欢一个页面,但是我只是代表我有一个类似于页面的ios游戏.Extreme Road Trip成功地让您喜欢他们自己的页面.我希望我现在做的时候能多关注一下...... (2认同)