我正在使用Koala gem,在我的UI中,我有一个分享链接。如何使用帖子id共享帖子。可以这样做吗?
@facebook = FacebookToken.first
@graph = Koala::Facebook::API.new(@facebook.access_token)
@graph.put_object(params[:post_id], "share",:message => "First!")它会给出以下错误
Koala::Facebook::ClientError: type: OAuthException, code: 240, message: (#240) Requires a valid user is specified (either via the session or via the API parameter for specifying the user. [HTTP 403]我认为许可出了问题。我在fave应用程序中添加了以下权限
"share_item,manage_pages,publish_stream,read_stream,offline_access,create_event,read_insights, manage_notifications"我是否需要其他权限才能使用帖子id共享帖子
发布于 2013-01-04 04:47:00
put_object中的第一个参数不是帖子ID,而是分享它的人的ID,可以是页面或用户。
因此,与其说:
@graph.put_object(params[:post_id] ...你会说:
//the current user
@graph.put_object('me' ...
or
//any user that you have a UID for
@graph.put_object(@user.uid ...
or
//a page that you have post permissions for
@graph.put_object(@facebook_page.id ...另外,在考拉的未来版本中,put_object将有所不同,您应该继续切换到。
https://stackoverflow.com/questions/13947074
复制相似问题