让应用程序的问题张贴到网页 [英] Problems getting app to post to a page

查看:118
本文介绍了让应用程序的问题张贴到网页的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序的目的纯粹是拿新闻,我的网站上创建的,并让他们在我的Facebook页面墙上自动发布。 (不是用户,而是一个商业页)。我已经成功地让应用程序发布到我的用户墙上,但有几个问题这一点。首先,我需要它来发布我公司网页上,而到期的access_token。我不希望它到期,它需要保持活跃,使任何后到我的网站将继续发布到Facebook。

The goal of my app is purely to take news items, created on my website, and have them posted on the wall of my facebook page automatically. (not a user, but a business page). I have succeeded in getting the app to post to my user wall, but there several issues with that. For one, I need it to post on my BUSINESS page, and the access_token expires. I don't want it to expire, it needs to stay active so that any post to my website will continue to post to facebook.

有谁知道任何直接的方式来这样做呢?开这让我这么远是这样的: http://nocturnsoft.com/devblog/?p=906 。最终,两件事情我需要知道的是如何张贴到公司网页使用图形API,我需要知道如何延长我的access_token的生活。

Does anybody know of any straight forward way to doing this? The on that got me this far was this: http://nocturnsoft.com/devblog/?p=906. In the end, the two things I need to know is how to post to a business page using graph API, and I need to know how to extend the life of my access_token.

感谢

推荐答案

您需要一些事情来实现这一点:

You need several things to achieve this:


  • 活动的access_token 用户谁是该网页的管理员。

  • manage_pages publish_stream 由该用户授予的权限。

  • 的access_token (你可以从帐户获得 用户的连接对象)结果
    GET http://graph.facebook.com/me/accounts (将返回的细节阵列,每用户页面本身,与的access_token 包含的每一页)

  • 创建 通过使用网页发布 POST 要求 http://graph.facebook.com/PAGE_ID/feed 的access_token

  • Active access_token for user who is admin of that page.
  • manage_pages and publish_stream permissions granted by that user.
  • Page access_token (which you can get from accounts connection of user object)
    GET http://graph.facebook.com/me/accounts (will return array of details for every pages user own, with access_token included for every page)
  • Create post by issuing POST requests to http://graph.facebook.com/PAGE_ID/feed using page access_token.

至于你说的的access_token 的东西,可以到期,你不能禁用此(这不是一件坏事,其实你可以在有限的时间,因为 offline_access 允许存在,但这是德precated ),但所描述的,你可以长达60天延长到期期限在离线访问权限的德precation 的开发者博客帖子。

As you said access_token is something that can expire, you can't disable this (and it's not something bad, actually you can for a limited time because offline_access permission exists, but it's deprecated) but you can extend the expire period for up to 60 days as described in Deprecation of Offline Access Permission developers blog post.

这篇关于让应用程序的问题张贴到网页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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