“喜欢”使用 Facebook Graph API、Objective C 的页面
我试图允许我的 iOS 应用程序的用户使用以下代码“喜欢”页面:
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 的一部分,因为它说您可以使用它来“喜欢”任何对象与 /Likes 连接。有什么帮助吗?
I'm trying to allow the user of my iOS app to "Like" a page using the following code:
NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:@"access_token",[[NSUserDefaults standardUserDefaults] objectForKey:@"fb_accessToken"], nil];
[facebook requestWithGraphPath:@"PAGE_ID/likes" andParams:params andHttpMethod:@"POST" andDelegate:self];
I get the error message:
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."}
}
}
This should be part of the Graph API because it says you can use that to "Like" any object with a /Likes connections. Any help?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
很抱歉带来坏消息,但显然您不能代表用户喜欢某个页面。但是,您可以代表用户对帖子、评论和照片进行点赞。
希望这是有道理的,我在过去的几个小时里一直在尝试做模拟。
富有的
Sorry to be the bearer of bad news, but apparently You can't like a Page on behalf of a user. You can, however, like posts, comments, and photos on behalf of a user.
Hope this makes sense, I've spent the last few hours trying to do simular.
Rich
这似乎最近发生了变化,但现在有一个新的 API - 请参阅 https: //developers.facebook.com/docs/opengraph/actions/builtin/likes/ 了解详细信息。
This appears to have recently changed, but now there is a new API - see https://developers.facebook.com/docs/opengraph/actions/builtin/likes/ for details.
https://developers.facebook.com/docs/reference/rest/stream。 addLike/
并对帖子点赞
并删除点赞
https://developers.facebook.com/docs/reference/rest/stream.addLike/
and like a post
and remove like
Eric Kassan 链接的页面的第二段指出:“og.likes 操作可以引用任何开放的图形对象或 URL,Facebook 页面或照片除外。”
The second paragraph of the page linked by Eric Kassan states that: "The og.likes action can refer to any open graph object or URL, except for Facebook Pages or Photos."
我花了10个小时来解决这个问题。
但不幸的是,没有办法……即使他们在“喜欢”图形 API 中说了“任何对象”,但它仅限于“用户,它是帖子、评论和照片”。
I have spent 10 hours for this solution.
But unfortunfortunitly there is not way.. even they have said "any object" in "likes" graph api but it's limited to only "users, it's posts, comments and photos".